Чет работает
This commit is contained in:
42
AllLibs/PeriphGeneral/Doc/latex/Makefile
Normal file
42
AllLibs/PeriphGeneral/Doc/latex/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
LATEX_CMD?=pdflatex
|
||||
MKIDX_CMD?=makeindex
|
||||
BIBTEX_CMD?=bibtex
|
||||
LATEX_COUNT?=8
|
||||
MANUAL_FILE?=refman
|
||||
|
||||
all: $(MANUAL_FILE).pdf
|
||||
|
||||
pdf: $(MANUAL_FILE).pdf
|
||||
|
||||
$(MANUAL_FILE).pdf: clean $(MANUAL_FILE).tex
|
||||
$(LATEX_CMD) $(MANUAL_FILE) || \
|
||||
if [ $$? != 0 ] ; then \
|
||||
\echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
|
||||
false; \
|
||||
fi
|
||||
$(MKIDX_CMD) $(MANUAL_FILE).idx
|
||||
$(LATEX_CMD) $(MANUAL_FILE) || \
|
||||
if [ $$? != 0 ] ; then \
|
||||
\echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
|
||||
false; \
|
||||
fi
|
||||
latex_count=$(LATEX_COUNT) ; \
|
||||
while grep -E -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\
|
||||
do \
|
||||
echo "Rerunning latex...." ;\
|
||||
$(LATEX_CMD) $(MANUAL_FILE) || \
|
||||
if [ $$? != 0 ] ; then \
|
||||
\echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
|
||||
false; \
|
||||
fi; \
|
||||
latex_count=`expr $$latex_count - 1` ;\
|
||||
done
|
||||
$(MKIDX_CMD) $(MANUAL_FILE).idx
|
||||
$(LATEX_CMD) $(MANUAL_FILE) || \
|
||||
if [ $$? != 0 ] ; then \
|
||||
\echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
|
||||
false; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl $(MANUAL_FILE).pdf
|
||||
198
AllLibs/PeriphGeneral/Doc/latex/____general__flash_8c_source.tex
Normal file
198
AllLibs/PeriphGeneral/Doc/latex/____general__flash_8c_source.tex
Normal file
@@ -0,0 +1,198 @@
|
||||
\doxysection{\+\_\+\+\_\+general\+\_\+flash.\+c}
|
||||
\hypertarget{____general__flash_8c_source}{}\label{____general__flash_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/\_\_general\_flash.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/\_\_general\_flash.c}}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00001}00001\ \textcolor{preprocessor}{\#include\ "{}\_\_general\_flash.h"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00002}00002\ FLASH\_EraseInitTypeDef\ EraseInitStruct;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00003}00003\ \textcolor{keyword}{extern}\ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00004}00004\ \textcolor{keywordtype}{unsigned}\ CRC\_Update;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00005}00005\ \textcolor{comment}{//uint32\_t\ PAGE\_OFFSET\ =\ ((uint32\_t)((4-\/1)\ *\ 0x0400));}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00006}00006\ uint32\_t\ PAGE\_NUMB\ =\ 127;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00007}00007\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00008}00008\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00009}00009\ \textcolor{comment}{/*\ Записать\ в\ память\ данные,\ произвольного\ размера\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00010}00010\ HAL\_StatusTypeDef\ FLASH\_Write\_Data(uint32\_t*\ Address,\ uint8\_t*\ Data,\ \textcolor{keywordtype}{int}\ Data\_size)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00011}00011\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00012}00012\ \ \ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00013}00013\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00014}00014\ \ \ \textcolor{keywordtype}{int}\ data\_cnt\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00015}00015\ \ \ uint32\_t\ adr;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00016}00016\ \ \ uint32\_t\ word\_data;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00017}00017\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00018}00018\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00019}00019\ \ \ res\_hal\ =\ HAL\_FLASH\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00020}00020\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00021}00021\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00022}00022\ \ \ \textcolor{keywordflow}{for}\ (adr\ =\ *Address;\ adr\ <\ *Address\ +\ Data\_size;\ adr\ =\ adr\ +\ 4)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00023}00023\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00024}00024\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00025}00025\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00026}00026\ \ \ \ \ word\_data\ =\ (}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00027}00027\ \ \ \ \ \ \ Data[data\_cnt]\ |}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00028}00028\ \ \ \ \ \ \ Data[data\_cnt\ +\ 1]\ <<\ 8\ |}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00029}00029\ \ \ \ \ \ \ Data[data\_cnt\ +\ 2]\ <<\ 16\ |}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00030}00030\ \ \ \ \ \ \ Data[data\_cnt\ +\ 3]\ <<\ 24);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00031}00031\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00032}00032\ \ \ \ \ res\_hal\ =\ HAL\_FLASH\_Program(FLASH\_TYPEPROGRAM\_WORD,\ adr,\ word\_data);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00033}00033\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00034}00034\ \ \ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00035}00035\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00036}00036\ \ \ \ \ data\_cnt\ +=\ 4;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00037}00037\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00038}00038\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00039}00039\ \ \ *Address\ +=\ Data\_size;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00040}00040\ \ \ res\_hal\ =\ HAL\_FLASH\_Lock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00041}00041\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00042}00042\ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00043}00043\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00044}00044\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00045}00045\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00046}00046\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00047}00047\ HAL\_StatusTypeDef\ FLASH\_Enable\_DualBankMode(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00048}00048\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00049}00049\ \ \ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00050}00050\ \ \ FLASH\_AdvOBProgramInitTypeDef\ OB\_DualBank;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00051}00051\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00052}00052\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00053}00053\ \ \ res\_hal\ =\ HAL\_FLASH\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00054}00054\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00055}00055\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00056}00056\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00057}00057\ \ \ res\_hal\ =\ HAL\_FLASH\_OB\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00058}00058\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00059}00059\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00060}00060\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00061}00061\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00062}00062\ \ \ FLASH-\/>OPTCR\ |=\ FLASH\_OPTCR\_DB1M;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00063}00063\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00064}00064\ \ \ res\_hal\ =\ HAL\_FLASH\_OB\_Launch();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00065}00065\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00066}00066\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00067}00067\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00068}00068\ \ \ res\_hal\ =\ HAL\_FLASH\_OB\_Lock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00069}00069\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00070}00070\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00071}00071\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00072}00072\ \ \ res\_hal\ =\ HAL\_FLASH\_Lock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00073}00073\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00074}00074\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00075}00075\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00076}00076\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00077}00077\ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00078}00078\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00079}00079\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00080}00080\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00081}00081\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00082}00082\ \textcolor{comment}{/*\ Убрать\ защиту\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00083}00083\ HAL\_StatusTypeDef\ FLASH\_WriteProtection(uint32\_t\ BankN,\ uint32\_t\ WriteProtection)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00084}00084\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00085}00085\ \ \ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00086}00086\ \ \ FLASH\_OBProgramInitTypeDef\ OBInit;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00087}00087\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00088}00088\ \ \ \ \ \textcolor{comment}{//\ Очистка\ всех\ возможных\ ошибок}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00089}00089\ \ \ FLASH-\/>SR\ |=\ FLASH\_FLAG\_WRPERR\ \ \textcolor{comment}{//\ Write\ Protection\ Error}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00090}00090\ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ FLASH\_FLAG\_PGSERR\ \ \textcolor{comment}{//\ Programming\ Sequence\ Error}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00091}00091\ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ FLASH\_FLAG\_PGAERR\ \ \textcolor{comment}{//\ Programming\ Alignment\ Error}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00092}00092\ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ FLASH\_FLAG\_OPERR;\ \ \textcolor{comment}{//\ Operation\ Error}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00093}00093\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00094}00094\ \ \ res\_hal\ =\ HAL\_FLASH\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00095}00095\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00096}00096\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00097}00097\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00098}00098\ \ \ res\_hal\ =\ HAL\_FLASH\_OB\_Unlock();\ \textcolor{comment}{//\ Разблокировка\ Option\ Bytes}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00099}00099\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00100}00100\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00101}00101\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00102}00102\ \ \ \textcolor{comment}{//\ Считываем\ текущую\ конфигурацию\ Option\ Bytes}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00103}00103\ \ \ HAL\_FLASHEx\_OBGetConfig(\&OBInit);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00104}00104\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00105}00105\ \ \ \textcolor{comment}{//\ Отключаем\ защиту\ на\ всех\ секторах\ второго\ банка}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00106}00106\ \ \ OBInit.OptionType\ =\ OPTIONBYTE\_WRP;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00107}00107\ \ \ OBInit.WRPState\ =\ WriteProtection;\ \textcolor{comment}{//\ Снять\ защиту}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00108}00108\ \ \ OBInit.WRPSector\ =\ OB\_WRP\_SECTOR\_12;\ \textcolor{comment}{//\ Снять\ защиту}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00109}00109\ \ \ OBInit.Banks\ =\ BankN;\ \textcolor{comment}{//\ Указываем\ второй\ банк}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00110}00110\ \ \ res\_hal\ =\ HAL\_FLASHEx\_OBProgram(\&OBInit);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00111}00111\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00112}00112\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00113}00113\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00114}00114\ \ \ \textcolor{comment}{//\ Записываем\ изменения\ и\ перезагружаем\ чип}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00115}00115\ \ \ res\_hal\ =\ HAL\_FLASH\_OB\_Launch();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00116}00116\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00117}00117\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00118}00118\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00119}00119\ \ \ \textcolor{comment}{//\ Считываем\ текущую\ конфигурацию\ Option\ Bytes}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00120}00120\ \ \ HAL\_FLASHEx\_OBGetConfig(\&OBInit);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00121}00121\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00122}00122\ \textcolor{comment}{//\ Блокировка\ Option\ Bytes}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00123}00123\ \ \ res\_hal\ =\ HAL\_FLASH\_OB\_Lock();\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00124}00124\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00125}00125\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00126}00126\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00127}00127\ \ \ res\_hal\ =\ HAL\_FLASH\_Lock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00128}00128\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00129}00129\ \ \ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00130}00130\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00131}00131\ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00132}00132\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00133}00133\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/ELEMENTARY\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00134}00134\ \textcolor{comment}{/*\ functions\ for\ reading\ bytes/halswords/words\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00135}00135\ uint8\_t\ FLASH\_Read\_Byte(uint32\_t\ add)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00136}00136\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00137}00137\ \ \ \textcolor{keywordflow}{return}\ (*(\_\_IO\ uint8\_t*)(add));}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00138}00138\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00139}00139\ uint16\_t\ FLASH\_Read\_HalfWord(uint32\_t\ add)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00140}00140\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00141}00141\ \ \ \textcolor{keywordflow}{return}\ (*(\_\_IO\ uint16\_t*)(add));}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00142}00142\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00143}00143\ uint32\_t\ FLASH\_Read\_Word(uint32\_t\ add)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00144}00144\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00145}00145\ \ \ \textcolor{keywordflow}{return}\ (*(\_\_IO\ uint32\_t*)(add));}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00146}00146\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00147}00147\ \textcolor{comment}{/*\ functions\ for\ writing\ bytes/halswords/words\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00148}00148\ HAL\_StatusTypeDef\ FLASH\_Write\_Byte(uint32\_t\ Address,\ uint8\_t\ Data)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00149}00149\ \{\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00150}00150\ \ \ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00151}00151\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00152}00152\ \ \ res\_hal\ =\ HAL\_FLASH\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00153}00153\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00154}00154\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00155}00155\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00156}00156\ \ \ res\_hal\ =\ HAL\_FLASH\_Program(FLASH\_TYPEPROGRAM\_BYTE,\ Address,\ (uint8\_t)(Data));}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00157}00157\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00158}00158\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00159}00159\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00160}00160\ \ \ res\_hal\ =\ HAL\_FLASH\_Lock();\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00161}00161\ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00162}00162\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00163}00163\ HAL\_StatusTypeDef\ FLASH\_Write\_HalfWord(uint32\_t\ Address,\ uint16\_t\ Data)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00164}00164\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00165}00165\ \ \ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00166}00166\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00167}00167\ \ \ res\_hal\ =\ HAL\_FLASH\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00168}00168\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00169}00169\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00170}00170\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00171}00171\ \ \ res\_hal\ =\ HAL\_FLASH\_Program(FLASH\_TYPEPROGRAM\_HALFWORD,\ Address,\ (uint16\_t)(Data));}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00172}00172\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00173}00173\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00174}00174\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00175}00175\ \ \ res\_hal\ =\ HAL\_FLASH\_Lock();\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00176}00176\ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00177}00177\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00178}00178\ HAL\_StatusTypeDef\ FLASH\_Write\_Word(uint32\_t\ Address,\ uint32\_t\ Data)}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00179}00179\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00180}00180\ \ \ HAL\_StatusTypeDef\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00181}00181\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00182}00182\ \ \ res\_hal\ =\ HAL\_FLASH\_Unlock();}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00183}00183\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00184}00184\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00185}00185\ \ \ res\_hal\ =\ HAL\_FLASH\_Program(FLASH\_TYPEPROGRAM\_WORD,\ Address,\ (uint32\_t)(Data));\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00186}00186\ \ \ \textcolor{keywordflow}{if}\ (res\_hal\ !=\ HAL\_OK)\ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00187}00187\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00188}00188\ \ \ res\_hal\ =\ HAL\_FLASH\_Lock();\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00189}00189\ \ \ \textcolor{keywordflow}{return}\ res\_hal;}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00190}00190\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00191}00191\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8c_source_l00192}00192\ }
|
||||
|
||||
\end{DoxyCode}
|
||||
@@ -0,0 +1,50 @@
|
||||
\doxysection{\+\_\+\+\_\+general\+\_\+flash.\+h}
|
||||
\hypertarget{____general__flash_8h_source}{}\label{____general__flash_8h_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/\_\_general\_flash.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/\_\_general\_flash.h}}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00001}00001\ \textcolor{comment}{/**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00002}00002\ \textcolor{comment}{*\ @file\ general\_flash.h}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00003}00003\ \textcolor{comment}{*\ @brief\ Заголовочны\ файл\ модуля\ работы\ с\ FLASH.}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00004}00004\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00005}00005\ \textcolor{preprocessor}{\#ifndef\ \_\_FLASH\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00006}00006\ \textcolor{preprocessor}{\#define\ \_\_FLASH\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00007}00007\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00008}00008\ \textcolor{comment}{//////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00009}00009\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00010}00010\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00011}00011\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00012}00012\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00013}00013\ \textcolor{preprocessor}{\#include\ "{}mylibs\_defs.h"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00014}00014\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00015}00015\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00016}00016\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00017}00017\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00018}00018\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00019}00019\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00020}00020\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00021}00021\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00022}00022\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00023}00023\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00024}00024\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00025}00025\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00026}00026\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00027}00027\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00028}00028\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00029}00029\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00030}00030\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00031}00031\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00032}00032\ HAL\_StatusTypeDef\ FLASH\_Enable\_DualBankMode(\textcolor{keywordtype}{void});}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00033}00033\ HAL\_StatusTypeDef\ FLASH\_WriteProtection(uint32\_t\ BankN,\ uint32\_t\ WriteProtection);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00034}00034\ \textcolor{comment}{/*\ functions\ for\ reading\ bytes/halswords/words\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00035}00035\ uint8\_t\ FLASH\_Read\_Byte(uint32\_t\ add);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00036}00036\ uint16\_t\ FLASH\_Read\_HalfWord(uint32\_t\ add);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00037}00037\ uint32\_t\ FLASH\_Read\_Word(uint32\_t\ add);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00038}00038\ \textcolor{comment}{/*\ functions\ for\ writing\ bytes/halswords/words\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00039}00039\ HAL\_StatusTypeDef\ FLASH\_Write\_Byte(uint32\_t\ Address,\ uint8\_t\ Data);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00040}00040\ HAL\_StatusTypeDef\ FLASH\_Write\_HalfWord(uint32\_t\ Address,\ uint16\_t\ Data);}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00041}00041\ HAL\_StatusTypeDef\ FLASH\_Write\_Word(uint32\_t\ Address,\ uint32\_t\ Data);\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00042}00042\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00043}00043\ }
|
||||
\DoxyCodeLine{\Hypertarget{____general__flash_8h_source_l00044}00044\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_FLASH\_GENERAL\_H\_}}
|
||||
|
||||
\end{DoxyCode}
|
||||
9
AllLibs/PeriphGeneral/Doc/latex/annotated.tex
Normal file
9
AllLibs/PeriphGeneral/Doc/latex/annotated.tex
Normal file
@@ -0,0 +1,9 @@
|
||||
\doxysection{Class List}
|
||||
Here are the classes, structs, unions and interfaces with brief descriptions\+:\begin{DoxyCompactList}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \\*Структура светодиода }{\pageref{struct_g_p_i_o___l_e_d_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \\*Структура кнопки }{\pageref{struct_g_p_i_o___switch_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \\*Структура настроек SPI }{\pageref{struct_s_p_i___settings_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \\*Структура инициализации енкодера }{\pageref{struct_t_i_m___encoder_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}} \\*Структура инициализации таймера }{\pageref{struct_t_i_m___settings_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \\*Структура настроек UART }{\pageref{struct_u_a_r_t___settings_type_def}}{}
|
||||
\end{DoxyCompactList}
|
||||
745
AllLibs/PeriphGeneral/Doc/latex/doxygen.sty
Normal file
745
AllLibs/PeriphGeneral/Doc/latex/doxygen.sty
Normal file
@@ -0,0 +1,745 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{doxygen}
|
||||
|
||||
% Packages used by this style file
|
||||
\RequirePackage{alltt}
|
||||
%%\RequirePackage{array} %% moved to refman.tex due to workaround for LaTex 2019 version and unmaintained tabu package
|
||||
\RequirePackage{calc}
|
||||
\RequirePackage{float}
|
||||
%%\RequirePackage{ifthen} %% moved to refman.tex due to workaround for LaTex 2019 version and unmaintained tabu package
|
||||
\RequirePackage{verbatim}
|
||||
\RequirePackage[table]{xcolor}
|
||||
\RequirePackage{longtable_doxygen}
|
||||
\RequirePackage{tabu_doxygen}
|
||||
\RequirePackage{fancyvrb}
|
||||
\RequirePackage{tabularx}
|
||||
\RequirePackage{multicol}
|
||||
\RequirePackage{multirow}
|
||||
\RequirePackage{hanging}
|
||||
\RequirePackage{ifpdf}
|
||||
\RequirePackage{adjustbox}
|
||||
\RequirePackage{amssymb}
|
||||
\RequirePackage{stackengine}
|
||||
\RequirePackage{enumitem}
|
||||
\RequirePackage{alphalph}
|
||||
\RequirePackage[normalem]{ulem} % for strikeout, but don't modify emphasis
|
||||
|
||||
%---------- Internal commands used in this style file ----------------
|
||||
|
||||
\newcommand{\ensurespace}[1]{%
|
||||
\begingroup%
|
||||
\setlength{\dimen@}{#1}%
|
||||
\vskip\z@\@plus\dimen@%
|
||||
\penalty -100\vskip\z@\@plus -\dimen@%
|
||||
\vskip\dimen@%
|
||||
\penalty 9999%
|
||||
\vskip -\dimen@%
|
||||
\vskip\z@skip% hide the previous |\vskip| from |\addvspace|
|
||||
\endgroup%
|
||||
}
|
||||
|
||||
\newcommand{\DoxyHorRuler}[1]{%
|
||||
\setlength{\parskip}{0ex plus 0ex minus 0ex}%
|
||||
\ifthenelse{#1=0}%
|
||||
{%
|
||||
\hrule%
|
||||
}%
|
||||
{%
|
||||
\hrulefilll%
|
||||
}%
|
||||
}
|
||||
\newcommand{\DoxyLabelFont}{}
|
||||
\newcommand{\entrylabel}[1]{%
|
||||
{%
|
||||
\parbox[b]{\labelwidth-4pt}{%
|
||||
\makebox[0pt][l]{\DoxyLabelFont#1}%
|
||||
\vspace{1.5\baselineskip}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newenvironment{DoxyDesc}[1]{%
|
||||
\ensurespace{4\baselineskip}%
|
||||
\begin{list}{}{%
|
||||
\settowidth{\labelwidth}{20pt}%
|
||||
%\setlength{\parsep}{0pt}%
|
||||
\setlength{\itemsep}{0pt}%
|
||||
\setlength{\leftmargin}{\labelwidth+\labelsep}%
|
||||
\renewcommand{\makelabel}{\entrylabel}%
|
||||
}%
|
||||
\item[#1]%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
\newsavebox{\xrefbox}
|
||||
\newlength{\xreflength}
|
||||
\newcommand{\xreflabel}[1]{%
|
||||
\sbox{\xrefbox}{#1}%
|
||||
\setlength{\xreflength}{\wd\xrefbox}%
|
||||
\ifthenelse{\xreflength>\labelwidth}{%
|
||||
\begin{minipage}{\textwidth}%
|
||||
\setlength{\parindent}{0pt}%
|
||||
\hangindent=15pt\bfseries #1\vspace{1.2\itemsep}%
|
||||
\end{minipage}%
|
||||
}{%
|
||||
\parbox[b]{\labelwidth}{\makebox[0pt][l]{\textbf{#1}}}%
|
||||
}%
|
||||
}
|
||||
|
||||
%---------- Commands used by doxygen LaTeX output generator ----------
|
||||
|
||||
% Used by <pre> ... </pre>
|
||||
\newenvironment{DoxyPre}{%
|
||||
\small%
|
||||
\begin{alltt}%
|
||||
}{%
|
||||
\end{alltt}%
|
||||
\normalsize%
|
||||
}
|
||||
% Necessary for redefining not defined characters, i.e. "Replacement Character" in tex output.
|
||||
\newlength{\CodeWidthChar}
|
||||
\newlength{\CodeHeightChar}
|
||||
\settowidth{\CodeWidthChar}{?}
|
||||
\settoheight{\CodeHeightChar}{?}
|
||||
% Necessary for hanging indent
|
||||
\newlength{\DoxyCodeWidth}
|
||||
|
||||
\newcommand\DoxyCodeLine[1]{
|
||||
\ifthenelse{\equal{\detokenize{#1}}{}}
|
||||
{
|
||||
\vspace*{\baselineskip}
|
||||
}
|
||||
{
|
||||
\hangpara{\DoxyCodeWidth}{1}{#1}\par
|
||||
}
|
||||
}
|
||||
|
||||
\newcommand\NiceSpace{%
|
||||
\discretionary{}{\kern\fontdimen2\font}{\kern\fontdimen2\font}%
|
||||
}
|
||||
|
||||
% Used by @code ... @endcode
|
||||
\newenvironment{DoxyCode}[1]{%
|
||||
\par%
|
||||
\vspace{2pt}%
|
||||
\scriptsize%
|
||||
\normalfont\ttfamily%
|
||||
\rightskip0pt plus 1fil%
|
||||
\settowidth{\DoxyCodeWidth}{000000}%
|
||||
\settowidth{\CodeWidthChar}{?}%
|
||||
\settoheight{\CodeHeightChar}{?}%
|
||||
\setlength{\parskip}{0ex plus 0ex minus 0ex}%
|
||||
\ifthenelse{\equal{#1}{0}}%
|
||||
{%
|
||||
{\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces%
|
||||
}%
|
||||
{%
|
||||
{\lccode`~32 \lowercase{\global\let~}}\obeyspaces%
|
||||
}%
|
||||
\vspace{2pt}%
|
||||
}{%
|
||||
\normalfont%
|
||||
\normalsize%
|
||||
\settowidth{\CodeWidthChar}{?}%
|
||||
\settoheight{\CodeHeightChar}{?}%
|
||||
}
|
||||
|
||||
% Redefining not defined characters, i.e. "Replacement Character" in tex output.
|
||||
\def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{%
|
||||
\textcolor{white}{\sffamily\bfseries\small ?}}{%
|
||||
\rotatebox{45}{$\blacksquare$}}}}
|
||||
|
||||
% Used by @example, @include, @includelineno and @dontinclude
|
||||
\newenvironment{DoxyCodeInclude}[1]{%
|
||||
\DoxyCode{#1}%
|
||||
}{%
|
||||
\endDoxyCode%
|
||||
}
|
||||
|
||||
% Used by @verbatim ... @endverbatim
|
||||
\newenvironment{DoxyVerb}{%
|
||||
\par%
|
||||
\footnotesize%
|
||||
\verbatim%
|
||||
}{%
|
||||
\endverbatim%
|
||||
\normalsize%
|
||||
}
|
||||
|
||||
% Used by @verbinclude
|
||||
\newenvironment{DoxyVerbInclude}{%
|
||||
\DoxyVerb%
|
||||
}{%
|
||||
\endDoxyVerb%
|
||||
}
|
||||
|
||||
% Used by numbered lists (using '-#' or <ol> ... </ol>)
|
||||
\setlistdepth{12}
|
||||
\newlist{DoxyEnumerate}{enumerate}{12}
|
||||
\setlist[DoxyEnumerate,1]{label=\arabic*.}
|
||||
\setlist[DoxyEnumerate,2]{label=(\enumalphalphcnt*)}
|
||||
\setlist[DoxyEnumerate,3]{label=\roman*.}
|
||||
\setlist[DoxyEnumerate,4]{label=\enumAlphAlphcnt*.}
|
||||
\setlist[DoxyEnumerate,5]{label=\arabic*.}
|
||||
\setlist[DoxyEnumerate,6]{label=(\enumalphalphcnt*)}
|
||||
\setlist[DoxyEnumerate,7]{label=\roman*.}
|
||||
\setlist[DoxyEnumerate,8]{label=\enumAlphAlphcnt*.}
|
||||
\setlist[DoxyEnumerate,9]{label=\arabic*.}
|
||||
\setlist[DoxyEnumerate,10]{label=(\enumalphalphcnt*)}
|
||||
\setlist[DoxyEnumerate,11]{label=\roman*.}
|
||||
\setlist[DoxyEnumerate,12]{label=\enumAlphAlphcnt*.}
|
||||
|
||||
% Used by bullet lists (using '-', @li, @arg, or <ul> ... </ul>)
|
||||
\setlistdepth{12}
|
||||
\newlist{DoxyItemize}{itemize}{12}
|
||||
\setlist[DoxyItemize]{label=\textperiodcentered}
|
||||
|
||||
\setlist[DoxyItemize,1]{label=\textbullet}
|
||||
\setlist[DoxyItemize,2]{label=\normalfont\bfseries \textendash}
|
||||
\setlist[DoxyItemize,3]{label=\textasteriskcentered}
|
||||
\setlist[DoxyItemize,4]{label=\textperiodcentered}
|
||||
|
||||
% Used for check boxes
|
||||
\newcommand{\DoxyUnchecked}{$\square$}
|
||||
\newcommand{\DoxyChecked}{\rlap{\raisebox{0.3ex}{\hspace{0.4ex}\tiny \checkmark}}$\square$}
|
||||
|
||||
% Used by description lists (using <dl> ... </dl>)
|
||||
\newenvironment{DoxyDescription}{%
|
||||
\description%
|
||||
}{%
|
||||
\enddescription%
|
||||
}
|
||||
|
||||
% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc
|
||||
% (only if caption is specified)
|
||||
\newenvironment{DoxyImage}{%
|
||||
\begin{figure}[H]%
|
||||
\centering%
|
||||
}{%
|
||||
\end{figure}%
|
||||
}
|
||||
|
||||
% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc
|
||||
% (only if no caption is specified)
|
||||
\newenvironment{DoxyImageNoCaption}{%
|
||||
\begin{center}%
|
||||
}{%
|
||||
\end{center}%
|
||||
}
|
||||
|
||||
% Used by @image
|
||||
% (only if inline is specified)
|
||||
\newenvironment{DoxyInlineImage}{%
|
||||
}{%
|
||||
}
|
||||
|
||||
% Used by @attention
|
||||
\newenvironment{DoxyAttention}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @important
|
||||
\newenvironment{DoxyImportant}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @author and @authors
|
||||
\newenvironment{DoxyAuthor}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @date
|
||||
\newenvironment{DoxyDate}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @invariant
|
||||
\newenvironment{DoxyInvariant}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @note
|
||||
\newenvironment{DoxyNote}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @post
|
||||
\newenvironment{DoxyPostcond}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @pre
|
||||
\newenvironment{DoxyPrecond}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @copyright
|
||||
\newenvironment{DoxyCopyright}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @remark
|
||||
\newenvironment{DoxyRemark}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @return and @returns
|
||||
\newenvironment{DoxyReturn}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @since
|
||||
\newenvironment{DoxySince}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @see
|
||||
\newenvironment{DoxySeeAlso}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @version
|
||||
\newenvironment{DoxyVersion}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @warning
|
||||
\newenvironment{DoxyWarning}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @par and @paragraph
|
||||
\newenvironment{DoxyParagraph}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by parameter lists
|
||||
\newenvironment{DoxyParams}[2][]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\ifthenelse{\equal{#1}{}}%
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description
|
||||
{\ifthenelse{\equal{#1}{1}}%
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc
|
||||
}
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for fields of simple structs
|
||||
\newenvironment{DoxyFields}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}%
|
||||
\multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for fields simple class style enums
|
||||
\newenvironment{DoxyEnumFields}[2][]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\ifthenelse{\equal{#1}{2}}%
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}}%
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,r]|X[-1,l]|}}% with init value
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for parameters within a detailed function description
|
||||
\newenvironment{DoxyParamCaption}{%
|
||||
\renewcommand{\item}[3][]{\\ \hspace*{2.0cm} ##1 {\em ##2}##3}%
|
||||
}{%
|
||||
}
|
||||
|
||||
% Used by return value lists
|
||||
\newenvironment{DoxyRetVals}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used by exception lists
|
||||
\newenvironment{DoxyExceptions}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used by template parameter lists
|
||||
\newenvironment{DoxyTemplParams}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for member lists
|
||||
\newenvironment{DoxyCompactItemize}{%
|
||||
\begin{itemize}%
|
||||
\setlength{\itemsep}{-3pt}%
|
||||
\setlength{\parsep}{0pt}%
|
||||
\setlength{\topsep}{0pt}%
|
||||
\setlength{\partopsep}{0pt}%
|
||||
}{%
|
||||
\end{itemize}%
|
||||
}
|
||||
|
||||
% Used for member descriptions
|
||||
\newenvironment{DoxyCompactList}{%
|
||||
\begin{list}{}{%
|
||||
\setlength{\leftmargin}{0.5cm}%
|
||||
\setlength{\itemsep}{0pt}%
|
||||
\setlength{\parsep}{0pt}%
|
||||
\setlength{\topsep}{0pt}%
|
||||
\renewcommand{\makelabel}{\hfill}%
|
||||
}%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used for reference lists (@bug, @deprecated, @todo, etc.)
|
||||
\newenvironment{DoxyRefList}{%
|
||||
\begin{list}{}{%
|
||||
\setlength{\labelwidth}{10pt}%
|
||||
\setlength{\leftmargin}{\labelwidth}%
|
||||
\addtolength{\leftmargin}{\labelsep}%
|
||||
\renewcommand{\makelabel}{\xreflabel}%
|
||||
}%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used by @bug, @deprecated, @todo, etc.
|
||||
\newenvironment{DoxyRefDesc}[1]{%
|
||||
\begin{list}{}{%
|
||||
\renewcommand\makelabel[1]{\textbf{##1}}%
|
||||
\settowidth\labelwidth{\makelabel{#1}}%
|
||||
\setlength\leftmargin{\labelwidth+\labelsep}%
|
||||
}%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used by parameter lists and simple sections
|
||||
\newenvironment{Desc}
|
||||
{\begin{list}{}{%
|
||||
\settowidth{\labelwidth}{20pt}%
|
||||
\setlength{\parsep}{0pt}%
|
||||
\setlength{\itemsep}{0pt}%
|
||||
\setlength{\leftmargin}{\labelwidth+\labelsep}%
|
||||
\renewcommand{\makelabel}{\entrylabel}%
|
||||
}
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used by tables
|
||||
\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}%
|
||||
\newenvironment{TabularC}[1]%
|
||||
{\tabulinesep=1mm
|
||||
\begin{longtabu*}spread 0pt [c]{*#1{|X[-1]}|}}%
|
||||
{\end{longtabu*}\par}%
|
||||
|
||||
\newenvironment{TabularNC}[1]%
|
||||
{\begin{tabu}spread 0pt [l]{*#1{|X[-1]}|}}%
|
||||
{\end{tabu}\par}%
|
||||
|
||||
% Used for member group headers
|
||||
\newenvironment{Indent}{%
|
||||
\begin{list}{}{%
|
||||
\setlength{\leftmargin}{0.5cm}%
|
||||
}%
|
||||
\item[]\ignorespaces%
|
||||
}{%
|
||||
\unskip%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used when hyperlinks are turned on
|
||||
\newcommand{\doxylink}[2]{%
|
||||
\mbox{\hyperlink{#1}{#2}}%
|
||||
}
|
||||
|
||||
% Used for the cite command
|
||||
\newcommand{\DoxyCite}[3]{%
|
||||
\ifthenelse{#3=1}% 1 with square parenthesis
|
||||
{
|
||||
\ifthenelse{\equal{#2}{number}}%
|
||||
{ \cite{#1} }%
|
||||
{%
|
||||
\ifthenelse{\equal{#2}{shortauthor}}%
|
||||
{ \citetext{\citeauthor{#1}} }%
|
||||
{%
|
||||
\ifthenelse{\equal{#2}{year}}%
|
||||
{ \citeyearpar{#1} }%
|
||||
{}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
{%
|
||||
\ifthenelse{\equal{#2}{number}}%
|
||||
{ \citealp{#1} }%
|
||||
{%
|
||||
\ifthenelse{\equal{#2}{shortauthor}}%
|
||||
{ \citeauthor{#1} }%
|
||||
{%
|
||||
\ifthenelse{\equal{#2}{year}}%
|
||||
{ \citeyear{#1} }%
|
||||
{}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
% Used when hyperlinks are turned on
|
||||
% Third argument is the SectionType, see the doxygen internal
|
||||
% documentation for the values (relevant: Page ... Subsubsection).
|
||||
\newcommand{\doxysectlink}[3]{%
|
||||
\mbox{\hyperlink{#1}{#2}}%
|
||||
}
|
||||
% Used when hyperlinks are turned off
|
||||
\newcommand{\doxyref}[3]{%
|
||||
\textbf{#1} (\textnormal{#2}\,\pageref{#3})%
|
||||
}
|
||||
|
||||
% Used when hyperlinks are turned off
|
||||
% Fourth argument is the SectionType, see the doxygen internal
|
||||
% documentation for the values (relevant: Page ... Subsubsection).
|
||||
\newcommand{\doxysectref}[4]{%
|
||||
\textbf{#1} (\textnormal{#2}\,\pageref{#3})%
|
||||
}
|
||||
|
||||
% Used to link to a table when hyperlinks are turned on
|
||||
\newcommand{\doxytablelink}[2]{%
|
||||
\ref{#1}%
|
||||
}
|
||||
|
||||
% Used to link to a table when hyperlinks are turned off
|
||||
\newcommand{\doxytableref}[3]{%
|
||||
\ref{#3}%
|
||||
}
|
||||
|
||||
% Used by @addindex
|
||||
\newcommand{\lcurly}{\{}
|
||||
\newcommand{\rcurly}{\}}
|
||||
|
||||
% Colors used for syntax highlighting
|
||||
\definecolor{comment}{rgb}{0.5,0.0,0.0}
|
||||
\definecolor{keyword}{rgb}{0.0,0.5,0.0}
|
||||
\definecolor{keywordtype}{rgb}{0.38,0.25,0.125}
|
||||
\definecolor{keywordflow}{rgb}{0.88,0.5,0.0}
|
||||
\definecolor{preprocessor}{rgb}{0.5,0.38,0.125}
|
||||
\definecolor{stringliteral}{rgb}{0.0,0.125,0.25}
|
||||
\definecolor{charliteral}{rgb}{0.0,0.5,0.5}
|
||||
\definecolor{xmlcdata}{rgb}{0.0,0.0,0.0}
|
||||
\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0}
|
||||
\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43}
|
||||
\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0}
|
||||
\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0}
|
||||
|
||||
% Color used for table heading
|
||||
\newcommand{\tableheadbgcolor}{lightgray}%
|
||||
|
||||
% Version of hypertarget with correct landing location
|
||||
\newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
|
||||
|
||||
% possibility to have sections etc. be within the margins
|
||||
% unfortunately had to copy part of book.cls and add \raggedright
|
||||
\makeatletter
|
||||
\newcounter{subsubsubsection}[subsubsection]
|
||||
\newcounter{subsubsubsubsection}[subsubsubsection]
|
||||
\newcounter{subsubsubsubsubsection}[subsubsubsubsection]
|
||||
\newcounter{subsubsubsubsubsubsection}[subsubsubsubsubsection]
|
||||
\renewcommand{\thesubsubsubsection}{\thesubsubsection.\arabic{subsubsubsection}}
|
||||
\renewcommand{\thesubsubsubsubsection}{\thesubsubsubsection.\arabic{subsubsubsubsection}}
|
||||
\renewcommand{\thesubsubsubsubsubsection}{\thesubsubsubsubsection.\arabic{subsubsubsubsubsection}}
|
||||
\renewcommand{\thesubsubsubsubsubsubsection}{\thesubsubsubsubsubsection.\arabic{subsubsubsubsubsubsection}}
|
||||
\newcommand{\subsubsubsectionmark}[1]{}
|
||||
\newcommand{\subsubsubsubsectionmark}[1]{}
|
||||
\newcommand{\subsubsubsubsubsectionmark}[1]{}
|
||||
\newcommand{\subsubsubsubsubsubsectionmark}[1]{}
|
||||
\def\toclevel@subsubsubsection{4}
|
||||
\def\toclevel@subsubsubsubsection{5}
|
||||
\def\toclevel@subsubsubsubsubsection{6}
|
||||
\def\toclevel@subsubsubsubsubsubsection{7}
|
||||
\def\toclevel@paragraph{8}
|
||||
\def\toclevel@subparagraph{9}
|
||||
|
||||
\newcommand\doxysection{\@startsection {section}{1}{\z@}%
|
||||
{-3.5ex \@plus -1ex \@minus -.2ex}%
|
||||
{2.3ex \@plus.2ex}%
|
||||
{\raggedright\normalfont\Large\bfseries}}
|
||||
\newcommand\doxysubsection{\@startsection{subsection}{2}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\large\bfseries}}
|
||||
\newcommand\doxysubsubsection{\@startsection{subsubsection}{3}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsection{\@startsection{subsubsubsection}{4}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsubsection{\@startsection{subsubsubsubsection}{5}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsubsubsection{\@startsection{subsubsubsubsubsection}{6}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsubsubsubsection{\@startsection{subsubsubsubsubsubsection}{7}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxyparagraph{\@startsection{paragraph}{8}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubparagraph{\@startsection{subparagraph}{9}{\parindent}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
|
||||
\newcommand\l@subsubsubsection{\@dottedtocline{4}{10.0em}{7.8em}}
|
||||
\newcommand\l@subsubsubsubsection{\@dottedtocline{5}{13.0em}{9.4em}}
|
||||
\newcommand\l@subsubsubsubsubsection{\@dottedtocline{6}{15.0em}{11em}}
|
||||
\newcommand\l@subsubsubsubsubsubsection{\@dottedtocline{7}{18.0em}{12.6em}}
|
||||
\renewcommand\l@paragraph{\@dottedtocline{8}{21.0em}{14.2em}}
|
||||
\renewcommand\l@subparagraph{\@dottedtocline{9}{24.0em}{15.8em}}
|
||||
\makeatother
|
||||
% the sectsty doesn't look to be maintained but gives, in our case, some warning like:
|
||||
% LaTeX Warning: Command \underline has changed.
|
||||
% Check if current package is valid.
|
||||
% unfortunately had to copy the relevant part
|
||||
\newcommand*{\doxypartfont} [1]
|
||||
{\gdef\SS@partnumberfont{\SS@sectid{0}\SS@nopart\SS@makeulinepartchap#1}
|
||||
\gdef\SS@parttitlefont{\SS@sectid{0}\SS@titlepart\SS@makeulinepartchap#1}}
|
||||
\newcommand*{\doxychapterfont} [1]
|
||||
{\gdef\SS@chapnumfont{\SS@sectid{1}\SS@nopart\SS@makeulinepartchap#1}
|
||||
\gdef\SS@chaptitlefont{\SS@sectid{1}\SS@titlepart\SS@makeulinepartchap#1}}
|
||||
\newcommand*{\doxysectionfont} [1]
|
||||
{\gdef\SS@sectfont{\SS@sectid{2}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxysubsectionfont} [1]
|
||||
{\gdef\SS@subsectfont{\SS@sectid{3}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxysubsubsectionfont} [1]
|
||||
{\gdef\SS@subsubsectfont{\SS@sectid{4}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxyparagraphfont} [1]
|
||||
{\gdef\SS@parafont{\SS@sectid{5}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxysubparagraphfont} [1]
|
||||
{\gdef\SS@subparafont{\SS@sectid{6}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxyminisecfont} [1]
|
||||
{\gdef\SS@minisecfont{\SS@sectid{7}\SS@rr\SS@makeulinepartchap#1}}
|
||||
\newcommand*{\doxyallsectionsfont} [1] {\doxypartfont{#1}%
|
||||
\doxychapterfont{#1}%
|
||||
\doxysectionfont{#1}%
|
||||
\doxysubsectionfont{#1}%
|
||||
\doxysubsubsectionfont{#1}%
|
||||
\doxyparagraphfont{#1}%
|
||||
\doxysubparagraphfont{#1}%
|
||||
\doxyminisecfont{#1}}%
|
||||
% Define caption that is also suitable in a table
|
||||
% for usage with hyperlinks
|
||||
\makeatletter
|
||||
\def\doxyfigcaption{%
|
||||
\H@refstepcounter{figure}%
|
||||
\@dblarg{\@caption{figure}}}
|
||||
|
||||
% for usage without hyperlinks
|
||||
\def\doxyfigcaptionnolink{%
|
||||
\refstepcounter{figure}%
|
||||
\@dblarg{\@caption{figure}}}
|
||||
\makeatother
|
||||
|
||||
% Define alpha enumarative names for counters > 26
|
||||
\makeatletter
|
||||
\def\enumalphalphcnt#1{\expandafter\@enumalphalphcnt\csname c@#1\endcsname}
|
||||
\def\@enumalphalphcnt#1{\alphalph{#1}}
|
||||
\def\enumAlphAlphcnt#1{\expandafter\@enumAlphAlphcnt\csname c@#1\endcsname}
|
||||
\def\@enumAlphAlphcnt#1{\AlphAlph{#1}}
|
||||
\makeatother
|
||||
\AddEnumerateCounter{\enumalphalphcnt}{\@enumalphalphcnt}{aa}
|
||||
\AddEnumerateCounter{\enumAlphAlphcnt}{\@enumAlphAlphcnt}{AA}
|
||||
2178
AllLibs/PeriphGeneral/Doc/latex/etoc_doxygen.sty
Normal file
2178
AllLibs/PeriphGeneral/Doc/latex/etoc_doxygen.sty
Normal file
File diff suppressed because it is too large
Load Diff
13
AllLibs/PeriphGeneral/Doc/latex/files.tex
Normal file
13
AllLibs/PeriphGeneral/Doc/latex/files.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\doxysection{File List}
|
||||
Here is a list of all documented files with brief descriptions\+:\begin{DoxyCompactList}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/\mbox{\hyperlink{____general__flash_8h_source}{\+\_\+\+\_\+general\+\_\+flash.\+h}} }{\pageref{____general__flash_8h_source}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/\mbox{\hyperlink{general__gpio_8h}{general\+\_\+gpio.\+h}} \\*Заголовочный файл для модуля инициализации портов и работы с ними }{\pageref{general__gpio_8h}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/\mbox{\hyperlink{general__spi_8h}{general\+\_\+spi.\+h}} \\*Заголовочный файл для модуля инициализации SPI }{\pageref{general__spi_8h}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/\mbox{\hyperlink{general__tim_8h}{general\+\_\+tim.\+h}} \\*Заголовочный файл для модуля инициализации таймеров и работы с ними }{\pageref{general__tim_8h}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/\mbox{\hyperlink{general__uart_8h}{general\+\_\+uart.\+h}} \\*Заголовочный файл для модуля инициализации UART }{\pageref{general__uart_8h}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/\mbox{\hyperlink{____general__flash_8c_source}{\+\_\+\+\_\+general\+\_\+flash.\+c}} }{\pageref{____general__flash_8c_source}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/\mbox{\hyperlink{general__gpio_8c}{general\+\_\+gpio.\+c}} \\*Модуль для инициализации портов и работы с ними }{\pageref{general__gpio_8c}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/\mbox{\hyperlink{general__spi_8c}{general\+\_\+spi.\+c}} \\*Модуль для инициализации SPI }{\pageref{general__spi_8c}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/\mbox{\hyperlink{general__tim_8c}{general\+\_\+tim.\+c}} \\*Модуль для инициализации таймеров и работы с ними }{\pageref{general__tim_8c}}{}
|
||||
\item\contentsline{section}{E\+:/.\+WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/\mbox{\hyperlink{general__uart_8c}{general\+\_\+uart.\+c}} \\*Модуль для инициализации UART }{\pageref{general__uart_8c}}{}
|
||||
\end{DoxyCompactList}
|
||||
53
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8c.tex
Normal file
53
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8c.tex
Normal file
@@ -0,0 +1,53 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/general\+\_\+gpio.c File Reference}
|
||||
\hypertarget{general__gpio_8c}{}\label{general__gpio_8c}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_gpio.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_gpio.c}}
|
||||
|
||||
|
||||
Модуль для инициализации портов и работы с ними.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}general\+\_\+gpio.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+gpio.\+c\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__gpio_8c__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\+\_\+\+Clock\+\_\+\+Enable}} (GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx)
|
||||
\begin{DoxyCompactList}\small\item\em Включить тактирование порта GPIO. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{GPIO\+\_\+\+LED\+\_\+\+Init}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN\+\_\+X, uint8\+\_\+t LED\+\_\+\+Active\+Level)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализировать светодиод (структуру светодиода) \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\+\_\+\+LED\+\_\+\+On}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Включить светодиод \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\+\_\+\+LED\+\_\+\+Off}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Выключить светодиод \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}{GPIO\+\_\+\+LED\+\_\+\+Set}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint8\+\_\+t led\+\_\+state)
|
||||
\begin{DoxyCompactList}\small\item\em Выставить светодиод по переменной \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{GPIO\+\_\+\+LED\+\_\+\+Blink\+\_\+\+Start}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint32\+\_\+t period)
|
||||
\begin{DoxyCompactList}\small\item\em Активировать моргание светодиодом \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}{GPIO\+\_\+\+LED\+\_\+\+Fading\+\_\+\+Start}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint32\+\_\+t period)
|
||||
\begin{DoxyCompactList}\small\item\em Активировать моргание светодиодом \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\+\_\+\+LED\+\_\+\+Dynamic\+\_\+\+Handle}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Управление динамическими режимами свечения светодиода \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\+\_\+\+Switch\+\_\+\+Init}} (\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}sw, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN\+\_\+X, uint8\+\_\+t SW\+\_\+\+Active\+Level)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализировать кнопку (структуру кнопки) \end{DoxyCompactList}\item
|
||||
int \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\+\_\+\+Read\+\_\+\+Switch}} (\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}sw)
|
||||
\begin{DoxyCompactList}\small\item\em Считать состоянии кнопки \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Модуль для инициализации портов и работы с ними.
|
||||
|
||||
Реализация функций для работы с GPIO\+:
|
||||
\begin{DoxyItemize}
|
||||
\item Включение тактирования портов
|
||||
\item Инициализация светодиодов и кнопок
|
||||
\item Управление светодиодами\+: включение, выключение, моргание, плавное затухание
|
||||
\item Чтение состояния кнопок с фильтром от дребезга
|
||||
\end{DoxyItemize}
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3d6438a8335228c1ca033e723e13d4a9
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8c__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8c__incl.pdf
Normal file
Binary file not shown.
332
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8c_source.tex
Normal file
332
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8c_source.tex
Normal file
@@ -0,0 +1,332 @@
|
||||
\doxysection{general\+\_\+gpio.\+c}
|
||||
\hypertarget{general__gpio_8c_source}{}\label{general__gpio_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_gpio.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_gpio.c}}
|
||||
\mbox{\hyperlink{general__gpio_8c}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_gpio.c}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Модуль\ для\ инициализации\ портов\ и\ работы\ с\ ними.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00006}00006\ \textcolor{comment}{*\ @details\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00007}00007\ \textcolor{comment}{Реализация\ функций\ для\ работы\ с\ GPIO:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00008}00008\ \textcolor{comment}{\ -\/\ Включение\ тактирования\ портов}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00009}00009\ \textcolor{comment}{\ -\/\ Инициализация\ светодиодов\ и\ кнопок}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00010}00010\ \textcolor{comment}{\ -\/\ Управление\ светодиодами:\ включение,\ выключение,\ моргание,\ плавное\ затухание}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00011}00011\ \textcolor{comment}{\ -\/\ Чтение\ состояния\ кнопок\ с\ фильтром\ от\ дребезга}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00012}00012\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00013}00013\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__gpio_8h}{general\_gpio.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00014}00014\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00015}00015\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00016}00016\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GPIO\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00017}00017\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00018}00018\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00019}00019\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00020}00020\ \textcolor{comment}{\ \ *\ @brief\ Включить\ тактирование\ порта\ GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00021}00021\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00022}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{00022}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(GPIO\_TypeDef\ *GPIOx)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00023}00023\ \{\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00024}00024\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_1(GPIOx))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00025}00025\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00026}00026\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00027}00027\ \ \ HAL\_StatusTypeDef\ status\ =\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00028}00028\ \ \ \textcolor{comment}{//\ choose\ port\ for\ enable\ clock}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00029}00029\ \ \ \textcolor{keywordflow}{if}\ (GPIOx==GPIOA)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00030}00030\ \ \ \ \ \_\_HAL\_RCC\_GPIOA\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00031}00031\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (GPIOx==GPIOB)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00032}00032\ \ \ \ \ \_\_HAL\_RCC\_GPIOB\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00033}00033\ \textcolor{preprocessor}{\#ifdef\ GPIOC}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00034}00034\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (GPIOx==GPIOC)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00035}00035\ \ \ \ \ \_\_HAL\_RCC\_GPIOC\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00036}00036\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00037}00037\ \textcolor{preprocessor}{\#ifdef\ GPIOD}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00038}00038\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (GPIOx==GPIOD)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00039}00039\ \ \ \ \ \_\_HAL\_RCC\_GPIOD\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00040}00040\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00041}00041\ \textcolor{preprocessor}{\#ifdef\ GPIOE}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00042}00042\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (GPIOx==GPIOE)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00043}00043\ \ \ \ \ \_\_HAL\_RCC\_GPIOE\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00044}00044\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00045}00045\ \textcolor{preprocessor}{\#ifdef\ GPIOF}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00046}00046\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (GPIOx==GPIOF)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00047}00047\ \ \ \ \ \_\_HAL\_RCC\_GPIOF\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00048}00048\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00049}00049\ \textcolor{preprocessor}{\#ifdef\ GPIOH}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00050}00050\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (GPIOx==GPIOF)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00051}00051\ \ \ \ \ \_\_HAL\_RCC\_GPIOH\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00052}00052\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00053}00053\ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00054}00054\ \ \ \ \ status\ =\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00055}00055\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00056}00056\ \ \ \textcolor{keywordflow}{return}\ status;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00057}00057\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00058}00058\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00059}00059\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GPIO\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00060}00060\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00061}00061\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00062}00062\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00063}00063\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00064}00064\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GPIO\ LED\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00065}00065\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00066}00066\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00067}00067\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализировать\ светодиод\ (структуру\ светодиода)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00068}00068\ \textcolor{comment}{\ \ *\ @param\ led\ \ \ \ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00069}00069\ \textcolor{comment}{\ \ *\ @param\ GPIOx\ \ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ структуру\ порта\ для\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00070}00070\ \textcolor{comment}{\ \ *\ @param\ GPIO\_PIN\_X\ \ \ \ \ \ \ Пин\ для\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00071}00071\ \textcolor{comment}{\ \ *\ @param\ LED\_ActiveLevel\ \ Состояния\ пина,\ при\ котором\ светодиод\ будет\ включен}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00072}00072\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00073}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{00073}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{GPIO\_LED\_Init}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ GPIO\_PIN\_X,\ uint8\_t\ LED\_ActiveLevel)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00074}00074\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00075}00075\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ GPIOx,\ GPIO\_PIN\_X))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00076}00076\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00077}00077\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00078}00078\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}}\ \ \ \ \ \ \ =\ GPIOx;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00079}00079\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}\ \ \ \ \ \ \ \ =\ GPIO\_PIN\_X;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00080}00080\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{LED\_ActiveLvl}}\ \ =\ LED\_ActiveLevel;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00081}00081\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00082}00082\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\_LED\_Off}}(led);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00083}00083\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00084}00084\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00085}00085\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00086}00086\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00087}00087\ \textcolor{comment}{\ \ *\ @brief\ \ Включить\ светодиод\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00088}00088\ \textcolor{comment}{\ \ *\ @param\ \ led\ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00089}00089\ \textcolor{comment}{\ \ *\ @return\ HAL\ Status}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00090}00090\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00091}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{00091}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\_LED\_On}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00092}00092\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00093}00093\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00094}00094\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00095}00095\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00096}00096\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}{LED\_IS\_ON}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00097}00097\ \ \ HAL\_GPIO\_WritePin(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{LED\_ActiveLvl}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00098}00098\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00099}00099\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00100}00100\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00101}00101\ \}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00102}00102\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00103}00103\ \textcolor{comment}{\ \ *\ @brief\ \ Выключить\ светодиод\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00104}00104\ \textcolor{comment}{\ \ *\ @param\ \ led\ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00105}00105\ \textcolor{comment}{\ \ *\ @return\ HAL\ Status}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00106}00106\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00107}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{00107}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\_LED\_Off}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00108}00108\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00109}00109\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00110}00110\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00111}00111\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00112}00112\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}{LED\_IS\_OFF}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00113}00113\ \ \ HAL\_GPIO\_WritePin(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}},\ !led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{LED\_ActiveLvl}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00114}00114\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00115}00115\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00116}00116\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00117}00117\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00118}00118\ \}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00119}00119\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00120}00120\ \textcolor{comment}{\ \ *\ @brief\ \ Выставить\ светодиод\ по\ переменной}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00121}00121\ \textcolor{comment}{\ \ *\ @param\ \ led\ \ \ \ \ \ \ \ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00122}00122\ \textcolor{comment}{\ \ *\ @param\ \ led\_state\ \ Состояние\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00123}00123\ \textcolor{comment}{\ \ *\ @return\ HAL\ Status}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00124}00124\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00125}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}{00125}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}{GPIO\_LED\_Set}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ uint8\_t\ led\_state)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00126}00126\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00127}00127\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00128}00128\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00129}00129\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00130}00130\ \ \ \textcolor{keywordflow}{if}(led\_state)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00131}00131\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00132}00132\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\_LED\_On}}(led);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00133}00133\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00134}00134\ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00135}00135\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00136}00136\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\_LED\_Off}}(led);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00137}00137\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00138}00138\ \}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00139}00139\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00140}00140\ \textcolor{comment}{\ \ *\ @brief\ \ Активировать\ моргание\ светодиодом}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00141}00141\ \textcolor{comment}{\ \ *\ @param\ \ led\ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00142}00142\ \textcolor{comment}{\ \ *\ @param\ \ period\ Период\ плавного\ моргания\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00143}00143\ \textcolor{comment}{\ \ *\ @return\ HAL\ Status}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00144}00144\ \textcolor{comment}{\ \ *\ @details\ \ Функция\ ставит\ режим\ моргания,\ который\ после\ управляется\ в\ @ref\ GPIO\_LED\_Dynamic\_Handle}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00145}00145\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00146}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{00146}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{GPIO\_LED\_Blink\_Start}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ uint32\_t\ period)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00147}00147\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00148}00148\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00149}00149\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00150}00150\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00151}00151\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{LED\_IS\_BLINKING}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00152}00152\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}}\ =\ period;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00153}00153\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00154}00154\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00155}00155\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00156}00156\ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00157}00157\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00158}00158\ \textcolor{comment}{\ \ *\ @brief\ \ Активировать\ моргание\ светодиодом}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00159}00159\ \textcolor{comment}{\ \ *\ @param\ \ led\ \ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00160}00160\ \textcolor{comment}{\ \ *\ @param\ \ period\ Период\ плавного\ моргания\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00161}00161\ \textcolor{comment}{\ \ *\ @return\ HAL\ Status}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00162}00162\ \textcolor{comment}{\ \ *\ @details\ \ Функция\ ставит\ режим\ моргания,\ который\ после\ управляется\ в\ @ref\ GPIO\_LED\_Dynamic\_Handle}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00163}00163\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00164}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}{00164}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}{GPIO\_LED\_Fading\_Start}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ uint32\_t\ period)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00165}00165\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00166}00166\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00167}00167\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00168}00168\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00169}00169\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}{LED\_IS\_FADING}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00170}00170\ \ \ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}}\ =\ period;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00171}00171\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00172}00172\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00173}00173\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00174}00174\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00175}00175\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00176}00176\ \textcolor{comment}{//uint8\_t\ LED\_PWM\_FADING\_DUTYS[LED\_PWM\_TICKS]\ =\ \{0\ 1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\ 11\ 12\ \}}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00177}00177\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00178}00178\ \textcolor{comment}{\ \ *\ @brief\ \ Управление\ динамическими\ режимами\ свечения\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00179}00179\ \textcolor{comment}{\ \ *\ @param\ \ Указатель\ на\ структуру\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00180}00180\ \textcolor{comment}{\ \ *\ @details\ \ Функция\ моргает/плавно\ моргает\ светодиодом\ в\ неблокирующем\ режиме}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00181}00181\ \textcolor{comment}{\ \ *\ Т.е.\ функцию\ надо\ вызывать\ постоянно,\ чтобы\ она\ мониторила\ тики\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00182}00182\ \textcolor{comment}{\ \ *\ и\ в\ нужный\ момент\ переключала\ светодиод}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00183}00183\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00184}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{00184}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\_LED\_Dynamic\_Handle}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00185}00185\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00186}00186\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(led,\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00187}00187\ \ \ \ \ \textcolor{keywordflow}{return};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00188}00188\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00189}00189\ \ \ \textcolor{comment}{/*\ Режим\ моргания\ светодиода\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00190}00190\ \ \ \textcolor{keywordflow}{if}(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ ==\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{LED\_IS\_BLINKING}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00191}00191\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00192}00192\ \ \ \ \ uint32\_t\ tickcurrent\ =\ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00193}00193\ \ \ \ \ \textcolor{comment}{/*\ Ожидание\ истечения\ периода\ моргания\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00194}00194\ \ \ \ \ \textcolor{keywordflow}{if}((tickcurrent\ -\/\ led-\/>tickprev)\ >\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00195}00195\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00196}00196\ \ \ \ \ \ \ \textcolor{comment}{/*\ Моргание\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00197}00197\ \ \ \ \ \ \ HAL\_GPIO\_TogglePin(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00198}00198\ \ \ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00199}00199\ \ \ \ \ \ \ led-\/>tickprev\ =\ tickcurrent;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00200}00200\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00201}00201\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00202}00202\ \ \ \textcolor{comment}{/*\ Режим\ плавного\ моргания\ светодиода\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00203}00203\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ ==\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}{LED\_IS\_FADING}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00204}00204\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00205}00205\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{unsigned}\ direction\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00206}00206\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ duty\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00207}00207\ \ \ \ \ uint32\_t\ tickcurrent\ =\ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00208}00208\ \ \ \ \ \textcolor{comment}{/*\ Ожидание\ момента\ изменения\ яркости\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00209}00209\ \ \ \ \ \textcolor{comment}{/*\ Период\ ШИМ\ 20\ мс,\ поэтому\ менять\ яроксть\ надо\ 40\ раз\ за\ период\ (туда\ обратно)\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00210}00210\ \ \ \ \ \textcolor{keywordflow}{if}((tickcurrent\ -\/\ led-\/>tickprev)\ >\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}}/(\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\_PWM\_TICKS}}*2))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00211}00211\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00212}00212\ \ \ \ \ \ \ \textcolor{comment}{/*\ Формирование\ разтухания\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00213}00213\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(direction\ ==\ 0)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00214}00214\ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00215}00215\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(++duty\ >=\ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\_PWM\_TICKS}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00216}00216\ \ \ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00217}00217\ \ \ \ \ \ \ \ \ \ \ direction\ =\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00218}00218\ \ \ \ \ \ \ \ \ \ \ duty\ =\ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\_PWM\_TICKS}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00219}00219\ \ \ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00220}00220\ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00221}00221\ \ \ \ \ \ \ \textcolor{comment}{/*\ Формирование\ затухания\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00222}00222\ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00223}00223\ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00224}00224\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(-\/-\/duty\ \ <=\ 0)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00225}00225\ \ \ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00226}00226\ \ \ \ \ \ \ \ \ \ \ direction\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00227}00227\ \ \ \ \ \ \ \ \ \ \ duty\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00228}00228\ \ \ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00229}00229\ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00230}00230\ \ \ \ \ \ \ led-\/>tickprev\ =\ tickcurrent;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00231}00231\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00232}00232\ \ \ \ \ \textcolor{comment}{/*\ Формирование\ ШИМ\ для\ изменения\ яркости\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00233}00233\ \ \ \ \ \textcolor{keywordtype}{int}\ duty\_crt\ =\ (duty*duty/\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\_PWM\_TICKS}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00234}00234\ \ \ \ \ \textcolor{keywordflow}{if}(tickcurrent\%\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\_PWM\_TICKS}}\ <\ duty\_crt)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00235}00235\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00236}00236\ \ \ \ \ \ \ HAL\_GPIO\_WritePin(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{LED\_ActiveLvl}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00237}00237\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00238}00238\ \ \ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00239}00239\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00240}00240\ \ \ \ \ \ \ HAL\_GPIO\_WritePin(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}},\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}},\ !led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{LED\_ActiveLvl}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00241}00241\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00242}00242\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00243}00243\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00244}00244\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GPIO\ LED\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00245}00245\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00246}00246\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00247}00247\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00248}00248\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GPIO\ SW\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00249}00249\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00250}00250\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00251}00251\ \textcolor{comment}{*\ @brief\ \ Инициализировать\ кнопку\ (структуру\ кнопки)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00252}00252\ \textcolor{comment}{\ \ *\ @param\ \ sw\ \ \ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ структуру\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00253}00253\ \textcolor{comment}{\ \ *\ @param\ \ GPIOx\ \ \ \ \ \ \ \ \ \ Указатель\ на\ структуру\ порта\ для\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00254}00254\ \textcolor{comment}{\ \ *\ @param\ \ GPIO\_PIN\_X\ \ \ \ \ Пин\ для\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00255}00255\ \textcolor{comment}{\ \ *\ @param\ \ SW\_ActiveLevel\ Состояния\ пина,\ когда\ кнопка\ нажата}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00256}00256\ \textcolor{comment}{\ \ *\ @return\ HAL\ Status}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00257}00257\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00258}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{00258}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\_Switch\_Init}}(\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}}\ *sw,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ GPIO\_PIN\_X,\ uint8\_t\ SW\_ActiveLevel)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00259}00259\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00260}00260\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(sw,\ GPIOx,\ GPIO\_PIN\_X))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00261}00261\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00262}00262\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00263}00263\ \ \ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}}\ \ \ \ \ \ \ =\ GPIOx;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00264}00264\ \ \ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}}\ \ \ \ \ \ \ \ =\ GPIO\_PIN\_X;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00265}00265\ \ \ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{Sw\_ActiveLvl}}\ \ =\ SW\_ActiveLevel;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00266}00266\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00267}00267\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00268}00268\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00269}00269\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00270}00270\ \textcolor{comment}{\ \ *\ @brief\ \ Считать\ состоянии\ кнопки\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00271}00271\ \textcolor{comment}{\ \ *\ @param\ \ sw\ \ Указатель\ на\ структуру\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00272}00272\ \textcolor{comment}{\ \ *\ @return\ 1\ -\/\ если\ кнопка\ нажата,\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00273}00273\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ 0\ -\/\ если\ отжата,\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00274}00274\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ -\/1\ -\/\ если\ ошибка}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00275}00275\ \textcolor{comment}{\ \ *\ @details\ \ Функция\ включает\ в\ себя\ неблокирующую\ проверку\ на\ дребезг}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00276}00276\ \textcolor{comment}{\ \ *\ Т.е.\ функцию\ надо\ вызывать\ постоянно,\ чтобы\ она\ мониторила\ состояние\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00277}00277\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00278}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{00278}}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\_Read\_Switch}}(\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}}\ *sw)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00279}00279\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00280}00280\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(sw,\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}},\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00281}00281\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00282}00282\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00283}00283\ \ \ \textcolor{keywordflow}{if}(HAL\_GPIO\_ReadPin(sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}},\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}})\ ==\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{Sw\_ActiveLvl}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00284}00284\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00285}00285\ \ \ \ \ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a245f1dc811279ce5d4598582db979a89}{Sw\_PrevState}}\ =\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00286}00286\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00287}00287\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00288}00288\ \ \ \ \ \textcolor{keywordflow}{if}(sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{Sw\_FilterDelay}})\ \textcolor{comment}{//\ если\ включена\ защита\ от\ дребезга}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00289}00289\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00290}00290\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(sw-\/>tickprev\ ==\ 0)}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00291}00291\ \ \ \ \ \ \ \ \ sw-\/>tickprev\ =\ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}();}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00292}00292\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00293}00293\ \ \ \ \ \ \ \textcolor{keywordflow}{if}((\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}()\ -\/\ sw-\/>tickprev)\ >=\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{Sw\_FilterDelay}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00294}00294\ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00295}00295\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(HAL\_GPIO\_ReadPin(sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}},\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}})\ ==\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{Sw\_ActiveLvl}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00296}00296\ \ \ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00297}00297\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00298}00298\ \ \ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00299}00299\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00300}00300\ \ \ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00301}00301\ \ \ \ \ \ \ \ \ \ \ sw-\/>tickprev\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00302}00302\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00303}00303\ \ \ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00304}00304\ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00305}00305\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00306}00306\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{comment}{//\ если\ нет\ защиты\ от\ дребезга}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00307}00307\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00308}00308\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(HAL\_GPIO\_ReadPin(sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}},\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}})\ ==\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{Sw\_ActiveLvl}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00309}00309\ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00310}00310\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00311}00311\ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00312}00312\ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00313}00313\ \ \ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00314}00314\ \ \ \ \ \ \ \ \ sw-\/>tickprev\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00315}00315\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00316}00316\ \ \ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00317}00317\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00318}00318\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00319}00319\ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00320}00320\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00321}00321\ \ \ \ \ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a245f1dc811279ce5d4598582db979a89}{Sw\_PrevState}}\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00322}00322\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00323}00323\ \ \ \textcolor{keywordflow}{return}\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00324}00324\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00325}00325\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GPIO\ SW\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00326}00326\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
|
||||
\end{DoxyCode}
|
||||
85
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h.tex
Normal file
85
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h.tex
Normal file
@@ -0,0 +1,85 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/general\+\_\+gpio.h File Reference}
|
||||
\hypertarget{general__gpio_8h}{}\label{general__gpio_8h}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_gpio.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_gpio.h}}
|
||||
|
||||
|
||||
Заголовочный файл для модуля инициализации портов и работы с ними.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}mylibs\+\_\+defs.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+gpio.\+h\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__gpio_8h__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
This graph shows which files directly or indirectly include this file\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=350pt]{general__gpio_8h__dep__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура светодиода \end{DoxyCompactList}\item
|
||||
struct \mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура кнопки \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Macros}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{local\+\_\+time}}()
|
||||
\begin{DoxyCompactList}\small\item\em Локальное время \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\+\_\+\+PWM\+\_\+\+TICKS}}~15
|
||||
\begin{DoxyCompactList}\small\item\em Количество тиков в периоде ШИМ \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}{LED\+\_\+\+ON}}~1
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина для включения светодиода \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}{LED\+\_\+\+OFF}}~0
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина для выключения светодиода \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga19d9e3aced311179a2914e0c9b13d0f9}{SW\+\_\+\+ON}}~1
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина при нажатой кнопке \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gacd8900c9ec0efde1da3253b718574067}{SW\+\_\+\+OFF}}~0
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина при отжатой кнопке \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Enumerations}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}{GPIO\+\_\+\+LEDState\+Type\+Def}} \{ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}{LED\+\_\+\+IS\+\_\+\+OFF}} = 0
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}{LED\+\_\+\+IS\+\_\+\+ON}} = 1
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{LED\+\_\+\+IS\+\_\+\+BLINKING}} = 2
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}{LED\+\_\+\+IS\+\_\+\+FADING}} = 3
|
||||
\}
|
||||
\begin{DoxyCompactList}\small\item\em Режимы работы светодиода \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\+\_\+\+Clock\+\_\+\+Enable}} (GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx)
|
||||
\begin{DoxyCompactList}\small\item\em Включить тактирование порта GPIO. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\+\_\+\+Switch\+\_\+\+Init}} (\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}sw, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN\+\_\+X, uint8\+\_\+t SW\+\_\+\+On\+\_\+\+State)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализировать кнопку (структуру кнопки) \end{DoxyCompactList}\item
|
||||
int \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\+\_\+\+Read\+\_\+\+Switch}} (\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}swstart)
|
||||
\begin{DoxyCompactList}\small\item\em Считать состоянии кнопки \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{GPIO\+\_\+\+LED\+\_\+\+Init}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN\+\_\+X, uint8\+\_\+t LED\+\_\+\+On\+\_\+\+State)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализировать светодиод (структуру светодиода) \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\+\_\+\+LED\+\_\+\+On}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Включить светодиод \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\+\_\+\+LED\+\_\+\+Off}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Выключить светодиод \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}{GPIO\+\_\+\+LED\+\_\+\+Set}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint8\+\_\+t led\+\_\+state)
|
||||
\begin{DoxyCompactList}\small\item\em Выставить светодиод по переменной \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{GPIO\+\_\+\+LED\+\_\+\+Blink\+\_\+\+Start}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint32\+\_\+t period)
|
||||
\begin{DoxyCompactList}\small\item\em Активировать моргание светодиодом \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}{GPIO\+\_\+\+LED\+\_\+\+Fading\+\_\+\+Start}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint32\+\_\+t period)
|
||||
\begin{DoxyCompactList}\small\item\em Активировать моргание светодиодом \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\+\_\+\+LED\+\_\+\+Dynamic\+\_\+\+Handle}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Управление динамическими режимами свечения светодиода \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Заголовочный файл для модуля инициализации портов и работы с ними.
|
||||
|
||||
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
18e746ec7466057e145ae212809aff82
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h__dep__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h__dep__incl.pdf
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
22dd8233ad55f1bd540759cc1612345c
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h__incl.pdf
Normal file
Binary file not shown.
244
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h_source.tex
Normal file
244
AllLibs/PeriphGeneral/Doc/latex/general__gpio_8h_source.tex
Normal file
@@ -0,0 +1,244 @@
|
||||
\doxysection{general\+\_\+gpio.\+h}
|
||||
\hypertarget{general__gpio_8h_source}{}\label{general__gpio_8h_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_gpio.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_gpio.h}}
|
||||
\mbox{\hyperlink{general__gpio_8h}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_gpio.h}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Заголовочный\ файл\ для\ модуля\ инициализации\ портов\ и\ работы\ с\ ними.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00006}00006\ \textcolor{comment}{*\ @defgroup\ GENERAL\_GPIO\ \ \ \ \ \ GPIO\ Tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ STM32\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00008}00008\ \textcolor{comment}{*\ @brief\ \ \ \ Функции\ и\ макросы\ для\ удобной\ работы\ с\ GPIO.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00009}00009\ \textcolor{comment}{*\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00010}00010\ \textcolor{comment}{Модуль\ предоставляет\ универсальные\ инструменты\ для\ работы\ с\ GPIO):}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00011}00011\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_GPIO\_GENERAL\ —\ инициализация\ и\ общие\ функции\ работы\ с\ портами.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00012}00012\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_GPIO\_SWITCH\ —\ работа\ с\ GPIO\ как\ с\ кнопкой:\ чтение\ состояния,\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00013}00013\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ фильтрация\ дребезга,\ настройка\ активного\ уровня.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00014}00014\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_GPIO\_LEDS\ —\ работа\ с\ GPIO\ как\ со\ светодиодом:\ включение,\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00015}00015\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ выключение,\ моргание\ и\ плавное\ затухание.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00016}00016\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00017}00017\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00018}00018\ \textcolor{preprocessor}{\#ifndef\ \_\_GPIO\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00019}00019\ \textcolor{preprocessor}{\#define\ \_\_GPIO\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00020}00020\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00021}00021\ \textcolor{preprocessor}{\#include\ "{}mylibs\_defs.h"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00022}00022\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00023}00023\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00024}00024\ \textcolor{comment}{\ \ *\ @addtogroup\ GPIO\_INIT\ GPIO\ Init\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00025}00025\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MYLIBS\_GPIO\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00026}00026\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_CONFIGS\ Конфигурации\ STM32\ General}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00027}00027\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Настройка\ состояний\ кнопок\ и\ количества\ тиков\ в\ периоде\ ШИМ}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00028}00028\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00029}00029\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00030}00030\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00031}00031\ \textcolor{preprocessor}{\#ifndef\ local\_time}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00032}\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{00032}}\ \textcolor{preprocessor}{\#define\ local\_time()\ \ HAL\_GetTick()\ }\textcolor{comment}{///<\ Локальное\ время}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00033}00033\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00034}00034\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00035}00035\ \textcolor{preprocessor}{\#ifndef\ LED\_PWM\_TICKS}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00036}\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{00036}}\ \textcolor{preprocessor}{\#define\ LED\_PWM\_TICKS\ 15\ }\textcolor{comment}{///<\ Количество\ тиков\ в\ периоде\ ШИМ}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00037}00037\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00038}00038\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00039}00039\ \textcolor{preprocessor}{\#ifndef\ LED\_ON}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00040}\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}{00040}}\ \textcolor{preprocessor}{\#define\ LED\_ON\ 1\ \ }\textcolor{comment}{///<\ Состояние\ пина\ для\ включения\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00041}00041\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00042}00042\ \textcolor{preprocessor}{\#ifndef\ LED\_OFF}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00043}\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}{00043}}\ \textcolor{preprocessor}{\#define\ LED\_OFF\ 0\ }\textcolor{comment}{///<\ Состояние\ пина\ для\ выключения\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00044}00044\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00045}00045\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00046}00046\ \textcolor{preprocessor}{\#ifndef\ SW\_ON}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00047}\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga19d9e3aced311179a2914e0c9b13d0f9}{00047}}\ \textcolor{preprocessor}{\#define\ SW\_ON\ 1\ \ \ }\textcolor{comment}{///<\ Состояние\ пина\ при\ нажатой\ кнопке}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00048}00048\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00049}00049\ \textcolor{preprocessor}{\#ifndef\ SW\_OFF}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00050}\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gacd8900c9ec0efde1da3253b718574067}{00050}}\ \textcolor{preprocessor}{\#define\ SW\_OFF\ 0\ \ }\textcolor{comment}{///<\ Состояние\ пина\ при\ отжатой\ кнопке}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00051}00051\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00052}00052\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00053}00053\ \textcolor{comment}{/**\ GPIO\_INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00054}00054\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00055}00055\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00056}00056\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00057}00057\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00058}00058\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00059}00059\ \textcolor{comment}{\ \ *\ @brief\ Режимы\ работы\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00060}00060\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_GPIO\_LEDS}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00061}00061\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00062}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}{00062}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00063}00063\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00064}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}{00064}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}{LED\_IS\_OFF}}\ =\ 0,\ \ \ \ \ \ \ \textcolor{comment}{///<\ Светодиод\ выключен}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00065}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}{00065}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}{LED\_IS\_ON}}\ =\ 1,\ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Светодиод\ включен}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00066}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{00066}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{LED\_IS\_BLINKING}}\ =\ 2,\ \ \textcolor{comment}{///<\ Моргание\ светодиодом}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00067}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}{00067}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}{LED\_IS\_FADING}}\ =\ 3,\ \ \ \ \textcolor{comment}{///<\ Плавное\ моргание\ светодиодом}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00068}00068\ \}\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}{GPIO\_LEDStateTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00069}00069\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00070}00070\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00071}00071\ \textcolor{comment}{\ \ *\ @brief\ Структура\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00072}00072\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_GPIO\_LEDS}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00073}00073\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00074}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{00074}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00075}00075\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00076}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{00076}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}{GPIO\_LEDStateTypeDef}}\ \mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}};\ \ \ \ \ \textcolor{comment}{///<\ Текущий\ режим\ работы\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00077}00077\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00078}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{00078}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a831923d4d157267ecc2f1add1c49adcf}{LED\_Port}};\ \ \ \ \ \ \ \ \textcolor{comment}{///<\ GPIO\ порт\ ножки\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00079}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{00079}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a684ff60e4c94daf2221524cdc6fcc978}{LED\_Pin}};\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ GPIO\ пин\ ножки\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00080}00080\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00081}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{00081}}\ \ \ uint8\_t\ \ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_abe9aadc0b28d042267f7155e187a1816}{LED\_ActiveLvl}};\ \ \ \ \textcolor{comment}{///<\ Активный\ уровень\ ножки\ (при\ котором\ светодиод\ горит)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00082}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{00082}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}};\ \ \ \ \ \ \ \textcolor{comment}{///<\ Период\ моргания\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00083}00083\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00084}00084\ \ \ uint32\_t\ \ \ \ \ \ tickprev;}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00085}00085\ \}\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00086}00086\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00087}00087\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00088}00088\ \textcolor{comment}{\ \ *\ @brief\ Структура\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00089}00089\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_GPIO\_SWITCH}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00090}00090\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00091}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{00091}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00092}00092\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00093}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{00093}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}};\ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ GPIO\ порт\ ножки\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00094}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{00094}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}};\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ GPIO\ пин\ ножки\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00095}00095\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00096}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{00096}}\ \ \ uint8\_t\ \ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{Sw\_ActiveLvl}};\ \ \ \ \ \textcolor{comment}{///<\ Активный\ уровень\ ножки\ (при\ котором\ кнопка\ нажата)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00097}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a245f1dc811279ce5d4598582db979a89}{00097}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a245f1dc811279ce5d4598582db979a89}{Sw\_PrevState}};\ \ \ \ \ \textcolor{comment}{///<\ Предыдущее\ состояние\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00098}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{00098}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{Sw\_FilterDelay}};\ \ \ \textcolor{comment}{///<\ Фильтр\ от\ дребезга\ (в\ мс)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00099}00099\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00100}00100\ \ \ uint32\_t\ \ \ \ \ \ tickprev;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00101}00101\ \}\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00102}00102\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00103}00103\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00104}00104\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00105}00105\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00106}00106\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00107}00107\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_GPIO\_GENERAL\ \ General\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00108}00108\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00109}00109\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Общие\ функции/макросы\ для\ работы\ с\ GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00110}00110\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00111}00111\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00112}00112\ \textcolor{comment}{\ \ \ \ //\ Включаем\ тактирование\ порта\ GPIOA}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00113}00113\ \textcolor{comment}{\ \ \ \ GPIO\_Clock\_Enable(GPIOA);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00114}00114\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00115}00115\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00116}00116\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00117}00117\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00118}00118\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(GPIO\_TypeDef\ *GPIOx);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00119}00119\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00120}00120\ \textcolor{comment}{/**\ MYLIBS\_GPIO\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00121}00121\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00122}00122\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00123}00123\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00124}00124\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00125}00125\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_GPIO\_SWITCH\ \ Switch\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00126}00126\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00127}00127\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Функции\ для\ работы\ с\ GPIO,\ как\ с\ кнопкой}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00128}00128\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00129}00129\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00130}00130\ \textcolor{comment}{\ \ \ \ MX\_GPIO\_Init();\ //\ инициализация\ пина\ аппаратная}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00131}00131\ \textcolor{comment}{\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00132}00132\ \textcolor{comment}{\ \ \ \ //\ Инициализация\ кнопки\ на\ порте\ GPIOB,\ пин\ 0,\ активный\ уровень\ 1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00133}00133\ \textcolor{comment}{\ \ \ \ GPIO\_SwitchTypeDef\ sw1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00134}00134\ \textcolor{comment}{\ \ \ \ GPIO\_Switch\_Init(\&sw1,\ GPIOB,\ GPIO\_PIN\_0,\ 1);\ //\ или\ дефайн\ SW\_ON/SW\_OFF}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00135}00135\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00136}00136\ \textcolor{comment}{\ \ \ \ //\ Считываем\ состояние\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00137}00137\ \textcolor{comment}{\ \ \ \ if(GPIO\_Read\_Switch(\&sw1))}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00138}00138\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00139}00139\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Кнопка\ нажата}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00140}00140\ \textcolor{comment}{\ \ \ \ \ \ \ \ LED\_ON();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00141}00141\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00142}00142\ \textcolor{comment}{\ \ \ \ else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00143}00143\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00144}00144\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Кнопка\ отжата}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00145}00145\ \textcolor{comment}{\ \ \ \ \ \ \ \ LED\_OFF();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00146}00146\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00147}00147\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00148}00148\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00149}00149\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00150}00150\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00151}00151\ \textcolor{comment}{/*\ Инициализировать\ кнопку\ (структуру\ кнопки)\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00152}00152\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\_Switch\_Init}}(\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}}\ *sw,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ GPIO\_PIN\_X,\ uint8\_t\ SW\_On\_State);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00153}00153\ \textcolor{comment}{/*\ Считать\ состоянии\ кнопки\ запуска\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00154}00154\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\_Read\_Switch}}(\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}}\ *swstart);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00155}00155\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00156}00156\ \textcolor{comment}{/**\ MYLIBS\_GPIO\_SWITCH}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00157}00157\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00158}00158\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00159}00159\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00160}00160\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00161}00161\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00162}00162\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_GPIO\_LEDS\ \ LED\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00163}00163\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00164}00164\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Функции\ для\ работы\ с\ GPIO,\ для\ управления\ светодиодом}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00165}00165\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00166}00166\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00167}00167\ \textcolor{comment}{\ \ \ \ MX\_GPIO\_Init();\ //\ инициализация\ пина\ аппаратная}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00168}00168\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00169}00169\ \textcolor{comment}{\ \ \ \ //\ Инициализация\ светодиода\ на\ порте\ GPIOA,\ пин\ 5,\ активный\ уровень\ 0}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00170}00170\ \textcolor{comment}{\ \ \ \ GPIO\_LEDTypeDef\ led;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00171}00171\ \textcolor{comment}{\ \ \ \ GPIO\_LED\_Init(\&led,\ GPIOA,\ GPIO\_PIN\_5,\ 0);\ //\ или\ дефайн\ LED\_ON/LED\_OFF}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00172}00172\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00173}00173\ \textcolor{comment}{\ \ \ \ //\ Включение\ светодиода}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00174}00174\ \textcolor{comment}{\ \ \ \ GPIO\_LED\_On(\&led);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00175}00175\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00176}00176\ \textcolor{comment}{\ \ \ \ //\ Запуск\ моргания}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00177}00177\ \textcolor{comment}{\ \ \ \ GPIO\_LED\_Blink\_Start(\&led,\ 500);\ //\ Период\ 500\ мс}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00178}00178\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00179}00179\ \textcolor{comment}{\ \ \ \ //\ В\ основном\ цикле}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00180}00180\ \textcolor{comment}{\ \ \ \ while\ (1)\ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00181}00181\ \textcolor{comment}{\ \ \ \ \ \ GPIO\_LED\_Dynamic\_Handle(\&led);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00182}00182\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00183}00183\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00184}00184\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00185}00185\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00186}00186\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00187}00187\ \textcolor{comment}{/*\ Инициализировать\ светодиод\ (структуру\ светодиода)\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00188}00188\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{GPIO\_LED\_Init}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ GPIO\_PIN\_X,\ uint8\_t\ LED\_On\_State);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00189}00189\ \textcolor{comment}{/*\ Включить\ светодиод\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00190}00190\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\_LED\_On}}\ (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00191}00191\ \textcolor{comment}{/*\ Выключить\ светодиод\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00192}00192\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\_LED\_Off}}\ (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00193}00193\ \textcolor{comment}{/*\ Выставить\ светодиод\ по\ переменной\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00194}00194\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}{GPIO\_LED\_Set}}\ (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ uint8\_t\ led\_state);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00195}00195\ \textcolor{comment}{/*\ Активировать\ моргание\ светодиодом\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00196}00196\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{GPIO\_LED\_Blink\_Start}}\ (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ uint32\_t\ period);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00197}00197\ \textcolor{comment}{/*\ Активировать\ моргание\ светодиодом\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00198}00198\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}{GPIO\_LED\_Fading\_Start}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led,\ uint32\_t\ period);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00199}00199\ \textcolor{comment}{/*\ Управление\ динамическими\ режимами\ свечения\ светодиода\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00200}00200\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\_LED\_Dynamic\_Handle}}(\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ *led);}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00201}00201\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00202}00202\ \textcolor{comment}{/**\ MYLIBS\_GPIO\_LEDS}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00203}00203\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00204}00204\ \textcolor{comment}{\ \ */}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00205}00205\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00206}00206\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00207}00207\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00208}00208\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00209}00209\ \textcolor{comment}{\ *\ @cond\ GPIO\_INTERNAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00210}00210\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00211}00211\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00212}00212\ \textcolor{comment}{//\ /**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00213}00213\ \textcolor{comment}{//\ \ \ *\ @brief\ Маппинг\ альтернативной\ функции\ SPI\ между\ GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00214}00214\ \textcolor{comment}{//\ \ \ *\ @ingroup\ \ MYLIBS\_GPIO\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00215}00215\ \textcolor{comment}{//\ \ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00216}00216\ \textcolor{comment}{//\ \#define\ SPI\_Alternate\_Mapping(INSTANCE)\ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00217}00217\ \textcolor{comment}{//\ ((((INSTANCE)\ ==\ TIM1)\ \ ||\ ((INSTANCE)\ ==\ TIM2))?\ \ \ \ \ GPIO\_AF1\_TIM1:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00218}00218\ \textcolor{comment}{//\ (((INSTANCE)\ ==\ TIM3)\ \ \ ||\ ((INSTANCE)\ ==\ TIM4)\ \ \ ||\ ((INSTANCE)\ ==\ TIM5))?\ GPIO\_AF2\_TIM3:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00219}00219\ \textcolor{comment}{//\ (((INSTANCE)\ ==\ TIM8)\ \ \ ||\ ((INSTANCE)\ ==\ TIM9)\ \ \ ||\ ((INSTANCE)\ ==\ TIM10)\ ||\ ((INSTANCE)\ ==\ TIM11))?\ GPIO\_AF3\_TIM8:\ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00220}00220\ \textcolor{comment}{//\ (((INSTANCE)\ ==\ TIM12)\ \ ||\ ((INSTANCE)\ ==\ TIM13)\ \ ||\ ((INSTANCE)\ ==\ TIM14))?\ GPIO\_AF9\_TIM12:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00221}00221\ \textcolor{comment}{//\ (0))}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00222}00222\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00223}00223\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00224}00224\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00225}00225\ \textcolor{comment}{\ \ *\ @brief\ Маппинг\ альтернативной\ функции\ TIM\ между\ GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00226}00226\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_GPIO\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00227}00227\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00228}00228\ \textcolor{preprocessor}{\#define\ GPIO\_TIM\_Alternate\_Mapping(INSTANCE)\ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00229}00229\ \textcolor{preprocessor}{((((INSTANCE)\ ==\ TIM1)\ \ ||\ ((INSTANCE)\ ==\ TIM2))?\ GPIO\_AF1\_TIM1:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00230}00230\ \textcolor{preprocessor}{(((INSTANCE)\ ==\ TIM3)\ \ \ ||\ ((INSTANCE)\ ==\ TIM4)\ \ \ ||\ ((INSTANCE)\ ==\ TIM5))?\ GPIO\_AF2\_TIM3:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00231}00231\ \textcolor{preprocessor}{(((INSTANCE)\ ==\ TIM8)\ \ \ ||\ ((INSTANCE)\ ==\ TIM9)\ \ \ ||\ ((INSTANCE)\ ==\ TIM10)\ ||\ ((INSTANCE)\ ==\ TIM11))?\ GPIO\_AF3\_TIM8:\ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00232}00232\ \textcolor{preprocessor}{(((INSTANCE)\ ==\ TIM12)\ \ ||\ ((INSTANCE)\ ==\ TIM13)\ \ ||\ ((INSTANCE)\ ==\ TIM14))?\ GPIO\_AF9\_TIM12:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00233}00233\ \textcolor{preprocessor}{(0))}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00234}00234\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00235}00235\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00236}00236\ \textcolor{comment}{/**\ @endcond\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00237}00237\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__gpio_8h_source_l00238}00238\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_GPIO\_GENERAL\_H\_}}
|
||||
|
||||
\end{DoxyCode}
|
||||
79
AllLibs/PeriphGeneral/Doc/latex/general__spi_8c.tex
Normal file
79
AllLibs/PeriphGeneral/Doc/latex/general__spi_8c.tex
Normal file
@@ -0,0 +1,79 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/general\+\_\+spi.c File Reference}
|
||||
\hypertarget{general__spi_8c}{}\label{general__spi_8c}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_spi.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_spi.c}}
|
||||
|
||||
|
||||
Модуль для инициализации SPI.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}general\+\_\+spi.\+h"{}}\newline
|
||||
{\ttfamily \#include "{}general\+\_\+gpio.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+spi.\+c\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=250pt]{general__spi_8c__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация SPI с помощью структуры \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{general__spi_8c_ae80d21e5cab86571709a2619442733b5}{SPI\+\_\+\+GPIO\+\_\+\+Init}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация GPIO для SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{general__spi_8c_abb78b8bd5303e88f969694e6fe03c411}{SPI\+\_\+\+DMA\+\_\+\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi, DMA\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hdma\+\_\+rx, DMA\+\_\+\+Stream\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}DMAChannel, uint32\+\_\+t DMA\+\_\+\+CHANNEL\+\_\+X)
|
||||
\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Настройка тактирования и прерываний SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\+\_\+\+Msp\+De\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний SPI. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Проверка корректности структуры инициализации SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Модуль для инициализации SPI.
|
||||
|
||||
Реализация функций для работы с SPI\+:
|
||||
\begin{DoxyItemize}
|
||||
\item Инициализация SPI и его линий CLK/\+MISO/\+MOSI
|
||||
\item Настройка GPIO для SPI
|
||||
\item Настройка NVIC и тактирования SPI
|
||||
\end{DoxyItemize}
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{general__spi_8c_doc-func-members}
|
||||
\doxysubsection{Function Documentation}
|
||||
\Hypertarget{general__spi_8c_ae80d21e5cab86571709a2619442733b5}\index{general\_spi.c@{general\_spi.c}!SPI\_GPIO\_Init@{SPI\_GPIO\_Init}}
|
||||
\index{SPI\_GPIO\_Init@{SPI\_GPIO\_Init}!general\_spi.c@{general\_spi.c}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_GPIO\_Init()}{SPI\_GPIO\_Init()}}
|
||||
{\footnotesize\ttfamily \label{general__spi_8c_ae80d21e5cab86571709a2619442733b5}
|
||||
void SPI\+\_\+\+GPIO\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация GPIO для SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sspi} & Указатель на структуру с настройками SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00058}{58}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{general__spi_8c_abb78b8bd5303e88f969694e6fe03c411}\index{general\_spi.c@{general\_spi.c}!SPI\_DMA\_Init@{SPI\_DMA\_Init}}
|
||||
\index{SPI\_DMA\_Init@{SPI\_DMA\_Init}!general\_spi.c@{general\_spi.c}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_DMA\_Init()}{SPI\_DMA\_Init()}}
|
||||
{\footnotesize\ttfamily \label{general__spi_8c_abb78b8bd5303e88f969694e6fe03c411}
|
||||
void SPI\+\_\+\+DMA\+\_\+\+Init (\begin{DoxyParamCaption}\item[{SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{hspi}{, }\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})}
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00089}{89}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b6ed71193901be4f48b3523dbb935568
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__spi_8c__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__spi_8c__incl.pdf
Normal file
Binary file not shown.
290
AllLibs/PeriphGeneral/Doc/latex/general__spi_8c_source.tex
Normal file
290
AllLibs/PeriphGeneral/Doc/latex/general__spi_8c_source.tex
Normal file
@@ -0,0 +1,290 @@
|
||||
\doxysection{general\+\_\+spi.\+c}
|
||||
\hypertarget{general__spi_8c_source}{}\label{general__spi_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_spi.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_spi.c}}
|
||||
\mbox{\hyperlink{general__spi_8c}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_spi.c}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Модуль\ для\ инициализации\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00006}00006\ \textcolor{comment}{Реализация\ функций\ для\ работы\ с\ SPI:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00007}00007\ \textcolor{comment}{\ \ -\/\ Инициализация\ SPI\ и\ его\ линий\ CLK/MISO/MOSI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00008}00008\ \textcolor{comment}{\ \ -\/\ Настройка\ GPIO\ для\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00009}00009\ \textcolor{comment}{\ \ -\/\ Настройка\ NVIC\ и\ тактирования\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00010}00010\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00011}00011\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__spi_8h}{general\_spi.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00012}00012\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__gpio_8h}{general\_gpio.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00013}00013\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00014}00014\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00015}00015\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/SPI\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00016}00016\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00017}00017\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ SPI\ с\ помощью\ структуры\ SPI\_SettingsTypeDef.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00018}00018\ \textcolor{comment}{\ \ *\ @param\ \ sspi\ Указатель\ на\ структуру\ с\ настройками\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00019}00019\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00020}00020\ \textcolor{comment}{\ \ *\ @details\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00021}00021\ \textcolor{comment}{\ \ *\ Инициализирует\ SPI\ и\ его\ GPIO.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00022}00022\ \textcolor{comment}{\ \ *\ Настройка\ аналогична\ HAL\_SPI\_Init\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00023}00023\ \textcolor{comment}{\ \ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00024}00024\ \textcolor{comment}{\ \ *\ suart.hspi.Init...}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00025}00025\ \textcolor{comment}{\ \ *\ @endcode\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00026}00026\ \textcolor{comment}{\ \ *\ но\ дополнительно\ надо\ прописать\ пины\ CLK/MISO/MOSI\ @ref\ SPI\_SettingsTypeDef}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00027}00027\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00028}\mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{00028}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\_Base\_Init}}(\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ *sspi)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00029}00029\ \{\ \textcolor{comment}{//\ function\ takes\ setting\ structure\ for\ init}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00030}00030\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00031}00031\ \ \ \textcolor{comment}{//\ check\ is\ settings\ are\ valid}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00032}00032\ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\_Check\_Init\_Struct}}(sspi)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00033}00033\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00034}00034\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00035}00035\ \ \ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\_MspInit}}(\&sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}});\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00036}00036\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00037}00037\ \ \ \textcolor{keywordflow}{if}\ (HAL\_SPI\_Init(\&sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00038}00038\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00039}00039\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00040}00040\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00041}00041\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00042}00042\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00043}00043\ \ \ \textcolor{comment}{//\ init\ gpio\ from\ SPISettings\ structure}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00044}00044\ \ \ \mbox{\hyperlink{general__spi_8c_ae80d21e5cab86571709a2619442733b5}{SPI\_GPIO\_Init}}(sspi);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00045}00045\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00046}00046\ \textcolor{comment}{//\ \ //\ init\ dma\ from\ SPISettings\ structure\ if\ need}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00047}00047\ \textcolor{comment}{//\ \ if\ (sspi-\/>DMAChannel\ !=\ 0)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00048}00048\ \textcolor{comment}{//\ \ \ \ SPI\_DMA\_Init(\&sspi-\/>hspi,\ sspi-\/>hspi.hdmarx,\ sspi-\/>DMAChannel,\ sspi-\/>DMA\_CHANNEL\_X);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00049}00049\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00050}00050\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00051}00051\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00052}00052\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00053}00053\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00054}00054\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00055}00055\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ GPIO\ для\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00056}00056\ \textcolor{comment}{\ \ *\ @param\ \ sspi\ Указатель\ на\ структуру\ с\ настройками\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00057}00057\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00058}\mbox{\hyperlink{general__spi_8c_ae80d21e5cab86571709a2619442733b5}{00058}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{general__spi_8c_ae80d21e5cab86571709a2619442733b5}{SPI\_GPIO\_Init}}(\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ *sspi)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00059}00059\ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00060}00060\ \ \ GPIO\_InitTypeDef\ GPIO\_InitStruct\ =\ \{0\};\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00061}00061\ \ \ \textcolor{comment}{//\ GPIO\ INIT\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00062}00062\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00063}00063\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00064}00064\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}});\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00065}00065\ \ \ \ \ \textcolor{comment}{//\ CLK\ PIN\ INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00066}00066\ \ \ GPIO\_InitStruct.Pin\ =\ sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{CLK\_PIN}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00067}00067\ \ \ GPIO\_InitStruct.Alternate\ =\ sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{CLK\_GPIO\_AlternageFunc}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00068}00068\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00069}00069\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_NOPULL;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00070}00070\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_VERY\_HIGH;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00071}00071\ \ \ HAL\_GPIO\_Init(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}},\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00072}00072\ \ \ \textcolor{comment}{//\ MISO\ PIN\ INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00073}00073\ \ \ GPIO\_InitStruct.Pin\ =\ sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{MISO\_PIN}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00074}00074\ \ \ GPIO\_InitStruct.Alternate\ =\ sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{MISO\_GPIO\_AlternageFunc}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00075}00075\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00076}00076\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_NOPULL;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00077}00077\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_VERY\_HIGH;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00078}00078\ \ \ HAL\_GPIO\_Init(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}},\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00079}00079\ \ \ \textcolor{comment}{//\ MOSI\ PIN\ INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00080}00080\ \ \ GPIO\_InitStruct.Pin\ =\ sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{MOSI\_PIN}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00081}00081\ \ \ GPIO\_InitStruct.Alternate\ =\ sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{MOSI\_GPIO\_AlternageFunc}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00082}00082\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00083}00083\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_NOPULL;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00084}00084\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_VERY\_HIGH;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00085}00085\ \ \ HAL\_GPIO\_Init(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}},\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00086}00086\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00087}00087\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00088}00088\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00089}00089\ \textcolor{keywordtype}{void}\ SPI\_DMA\_Init(SPI\_HandleTypeDef\ *hspi,\ DMA\_HandleTypeDef\ *hdma\_rx,\ DMA\_Stream\_TypeDef\ *DMAChannel,\ uint32\_t\ DMA\_CHANNEL\_X)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00090}00090\ \{\ \textcolor{comment}{//\ function\ takes\ spi\ and\ dma\ handlers\ and\ dmachannel\ for\ spi}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00091}00091\ \textcolor{comment}{//\ \ //\ for\ now\ only\ dma\ rx\ is\ supported,\ tx\ maybe\ later\ if\ needed}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00092}00092\ \textcolor{comment}{//\ \ \ \ //\ calc\ defines\ on\ boot\_project\_setup.h}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00093}00093\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00094}00094\ \textcolor{comment}{//\ \ /*\ SPI3\ DMA\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00095}00095\ \textcolor{comment}{//\ \ /*\ SPI3\_RX\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00096}00096\ \textcolor{comment}{//\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00097}00097\ \textcolor{comment}{//\ \ hdma\_rx-\/>Instance\ =\ DMAChannel;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00098}00098\ \textcolor{comment}{//\#if\ defined(STM32F4xx)\ //\ dma\ channel\ choose\ for\ 407}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00099}00099\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.Channel\ =\ DMA\_CHANNEL\_X;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00100}00100\ \textcolor{comment}{//\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00101}00101\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.Direction\ =\ DMA\_PERIPH\_TO\_MEMORY;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00102}00102\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.PeriphInc\ =\ DMA\_PINC\_DISABLE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00103}00103\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.MemInc\ =\ DMA\_MINC\_ENABLE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00104}00104\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.PeriphDataAlignment\ =\ DMA\_PDATAALIGN\_BYTE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00105}00105\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.MemDataAlignment\ =\ DMA\_MDATAALIGN\_BYTE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00106}00106\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.Mode\ =\ DMA\_CIRCULAR;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00107}00107\ \textcolor{comment}{//\ \ hdma\_rx-\/>Init.Priority\ =\ DMA\_PRIORITY\_LOW;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00108}00108\ \textcolor{comment}{//\ \ if\ (HAL\_DMA\_Init(hdma\_rx)\ !=\ HAL\_OK)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00109}00109\ \textcolor{comment}{//\ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00110}00110\ \textcolor{comment}{//\ \ \ \ MyLibs\_Error\_Handler();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00111}00111\ \textcolor{comment}{//\ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00112}00112\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00113}00113\ \textcolor{comment}{//\ \ \_\_USER\_LINKDMA(hspi,hdmarx,hdma\_rx);\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00114}00114\ \textcolor{comment}{//\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00115}00115\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00116}00116\ \textcolor{comment}{//\ \ //\ \_\_USER\_LINKDMA\ is\ need\ because\ \_\_HAL\_LINKDMA\ is\ written\ for\ global\ defined\ hdma\_rx}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00117}00117\ \textcolor{comment}{//\ \ //\ so\ you\ get\ error\ because\ hal\ uses\ .\ insted\ of\ -\/>}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00118}00118\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00119}00119\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00120}00120\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00121}00121\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00122}00122\ \textcolor{comment}{\ \ *\ @brief\ \ Настройка\ тактирования\ и\ прерываний\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00123}00123\ \textcolor{comment}{\ \ *\ @param\ \ hspi\ Указатель\ на\ хендл\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00124}00124\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ иницилизацией\ неиспользуемых\ SPI,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00125}00125\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ SPI\_INIT\ в\ @ref\ general\_spi.h\ определяются\ используемые\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00126}00126\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00127}\mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{00127}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\_MspInit}}(SPI\_HandleTypeDef\ *hspi)\ \textcolor{comment}{//\ analog\ for\ hal\ function}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00128}00128\ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00129}00129\ \ \ \textcolor{comment}{//\ rcc,\ dma\ and\ interrupt\ init\ for\ SPIs}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00130}00130\ \ \ \textcolor{comment}{//\ GPIO\ init\ was\ moved\ to\ own\ functions\ SPI\_GPIO\_Init\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00131}00131\ \ \ \textcolor{keywordflow}{if}(0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00132}00132\ \textcolor{preprocessor}{\#ifdef\ USE\_SPI1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00133}00133\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(hspi-\/>Instance==SPI1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00134}00134\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00135}00135\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00136}00136\ \textcolor{comment}{//\ \ /*\ DMA2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00137}00137\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA2\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00138}00138\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00139}00139\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA2\_Stream2\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00140}00140\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA2\_Stream2\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00141}00141\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00142}00142\ \ \ \textcolor{comment}{/*\ SPI1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00143}00143\ \ \ \_\_HAL\_RCC\_SPI1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00144}00144\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00145}00145\ \ \ \textcolor{comment}{/*\ SPI1\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00146}00146\ \ \ HAL\_NVIC\_SetPriority(SPI1\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00147}00147\ \ \ HAL\_NVIC\_EnableIRQ(SPI1\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00148}00148\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00149}00149\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_SPI1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00150}00150\ \textcolor{preprocessor}{\#ifdef\ USE\_SPI2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00151}00151\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(hspi-\/>Instance==SPI2)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00152}00152\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00153}00153\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00154}00154\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00155}00155\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00156}00156\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream5\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00157}00157\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream5\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00158}00158\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00159}00159\ \ \ \textcolor{comment}{/*\ SPI2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00160}00160\ \ \ \_\_HAL\_RCC\_SPI2\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00161}00161\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00162}00162\ \ \ \textcolor{comment}{/*\ SPI2\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00163}00163\ \ \ HAL\_NVIC\_SetPriority(SPI2\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00164}00164\ \ \ HAL\_NVIC\_EnableIRQ(SPI2\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00165}00165\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00166}00166\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_SPI2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00167}00167\ \textcolor{preprocessor}{\#ifdef\ USE\_SPI3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00168}00168\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(hspi-\/>Instance==SPI3)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00169}00169\ \ \ \{\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00170}00170\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00171}00171\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00172}00172\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00173}00173\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream1\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00174}00174\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream1\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00175}00175\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00176}00176\ \ \ \textcolor{comment}{/*\ SPI3\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00177}00177\ \ \ \_\_HAL\_RCC\_SPI3\_CLK\_ENABLE();\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00178}00178\ \ \ \textcolor{comment}{/*\ SPI3\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00179}00179\ \ \ HAL\_NVIC\_SetPriority(SPI3\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00180}00180\ \ \ HAL\_NVIC\_EnableIRQ(SPI3\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00181}00181\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00182}00182\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_SPI3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00183}00183\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00184}00184\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00185}00185\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00186}00186\ \textcolor{comment}{\ \ *\ @brief\ \ Деинициализация\ тактирования\ и\ прерываний\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00187}00187\ \textcolor{comment}{\ \ *\ @param\ \ hspi\ Указатель\ на\ хендл\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00188}00188\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ иницилизацией\ неиспользуемых\ SPI,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00189}00189\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ SPI\_INIT\ в\ @ref\ general\_spi.h\ определяются\ используемые\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00190}00190\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00191}\mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{00191}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\_MspDeInit}}(SPI\_HandleTypeDef\ *hspi)\ \textcolor{comment}{//\ analog\ for\ hal\ function}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00192}00192\ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00193}00193\ \ \ \textcolor{comment}{//\ rcc,\ dma\ and\ interrupt\ init\ for\ SPIs}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00194}00194\ \ \ \textcolor{comment}{//\ GPIO\ init\ was\ moved\ to\ own\ functions\ SPI\_GPIO\_Init\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00195}00195\ \ \ \textcolor{keywordflow}{if}(0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00196}00196\ \textcolor{preprocessor}{\#ifdef\ USE\_SPI1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00197}00197\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(hspi-\/>Instance==SPI1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00198}00198\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00199}00199\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00200}00200\ \textcolor{comment}{//\ \ /*\ DMA2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00201}00201\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA2\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00202}00202\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00203}00203\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA2\_Stream2\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00204}00204\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA2\_Stream2\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00205}00205\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00206}00206\ \ \ \textcolor{comment}{/*\ SPI1\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00207}00207\ \ \ \_\_HAL\_RCC\_SPI1\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00208}00208\ \ \ \_\_HAL\_RCC\_SPI1\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00209}00209\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00210}00210\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_SPI1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00211}00211\ \textcolor{preprocessor}{\#ifdef\ USE\_SPI2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00212}00212\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(hspi-\/>Instance==SPI2)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00213}00213\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00214}00214\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00215}00215\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00216}00216\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00217}00217\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream5\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00218}00218\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream5\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00219}00219\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00220}00220\ \ \ \textcolor{comment}{/*\ SPI2\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00221}00221\ \ \ \_\_HAL\_RCC\_SPI2\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00222}00222\ \ \ \_\_HAL\_RCC\_SPI2\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00223}00223\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00224}00224\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_SPI2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00225}00225\ \textcolor{preprocessor}{\#ifdef\ USE\_SPI3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00226}00226\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(hspi-\/>Instance==SPI3)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00227}00227\ \ \ \{\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00228}00228\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00229}00229\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00230}00230\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00231}00231\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream1\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00232}00232\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream1\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00233}00233\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00234}00234\ \ \ \textcolor{comment}{/*\ SPI3\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00235}00235\ \ \ \_\_HAL\_RCC\_SPI3\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00236}00236\ \ \ \_\_HAL\_RCC\_SPI3\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00237}00237\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00238}00238\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_SPI3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00239}00239\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00240}00240\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00241}00241\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00242}00242\ \textcolor{comment}{\ \ *\ @brief\ \ Проверка\ корректности\ структуры\ инициализации\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00243}00243\ \textcolor{comment}{\ \ *\ @param\ \ sspi\ Указатель\ на\ структуру\ с\ настройками\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00244}00244\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00245}00245\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00246}\mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{00246}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\_Check\_Init\_Struct}}(\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ *sspi)}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00247}00247\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00248}00248\ \ \ \textcolor{comment}{//\ check\ is\ settings\ are\ valid}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00249}00249\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_ALL\_INSTANCE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00250}00250\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00251}00251\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00252}00252\ \ \ \textcolor{comment}{//\ check\ init\ settings}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00253}00253\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_MODE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.Mode))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00254}00254\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00255}00255\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_DIRECTION(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.Direction))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00256}00256\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00257}00257\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_DATASIZE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.DataSize))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00258}00258\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00259}00259\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_BAUDRATE\_PRESCALER(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.BaudRatePrescaler))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00260}00260\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00261}00261\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_CPOL(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CLKPolarity))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00262}00262\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00263}00263\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_CPHA(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CLKPhase))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00264}00264\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00265}00265\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_NSS(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.NSS))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00266}00266\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00267}00267\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_FIRST\_BIT(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.FirstBit))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00268}00268\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00269}00269\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_CRC\_CALCULATION(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CRCCalculation))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00270}00270\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00271}00271\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_CRC\_POLYNOMIAL(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.NSS)\ \&\&\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00272}00272\ \ \ \ \ (sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CRCCalculation\ !=\ SPI\_CRCCALCULATION\_DISABLE))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00273}00273\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00274}00274\ \ \ \textcolor{keywordflow}{if}\ (!IS\_SPI\_TIMODE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.TIMode))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00275}00275\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00276}00276\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00277}00277\ \ \ \textcolor{comment}{//\ check\ gpio}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00278}00278\ \ \ \textcolor{keywordflow}{if}\ (!IS\_GPIO\_ALL\_INSTANCE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}})\ ||\ !IS\_GPIO\_ALL\_INSTANCE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}})\ ||\ !IS\_GPIO\_ALL\_INSTANCE(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00279}00279\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00280}00280\ \ \ \textcolor{keywordflow}{if}\ (!IS\_GPIO\_PIN(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{CLK\_PIN}})\ \&\&\ !IS\_GPIO\_PIN(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{MISO\_PIN}})\ \&\&\ !IS\_GPIO\_PIN(sspi-\/>\mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{MOSI\_PIN}}))\ \textcolor{comment}{//\ if\ both\ pins\ arent\ set\ up}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00281}00281\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00282}00282\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00283}00283\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8c_source_l00284}00284\ \}}
|
||||
|
||||
\end{DoxyCode}
|
||||
58
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h.tex
Normal file
58
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h.tex
Normal file
@@ -0,0 +1,58 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/general\+\_\+spi.h File Reference}
|
||||
\hypertarget{general__spi_8h}{}\label{general__spi_8h}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_spi.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_spi.h}}
|
||||
|
||||
|
||||
Заголовочный файл для модуля инициализации SPI.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}mylibs\+\_\+defs.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+spi.\+h\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__spi_8h__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
This graph shows which files directly or indirectly include this file\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__spi_8h__dep__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура настроек SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Macros}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\#define \mbox{\hyperlink{group___s_p_i___i_n_i_t_ga8ad4712bf4add56892d057778e826e0c}{HAL\+\_\+\+SPI\+\_\+\+MODULE\+\_\+\+ENABLED}}
|
||||
\begin{DoxyCompactList}\small\item\em Включение HAL SPI. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___s_p_i___i_n_i_t_ga2fe0c8aeb2c61679f32836fef479eedf}{USE\+\_\+\+SPI1}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить SPI1 в \doxylink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___s_p_i___i_n_i_t_ga53687cddb8e39e76a79b8ffaa152fb2b}{USE\+\_\+\+SPI2}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить SPI2 в \doxylink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___s_p_i___i_n_i_t_ga5fdd6e5934a8005ef05b80f6d95883dc}{USE\+\_\+\+SPI3}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить SPI3 в \doxylink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация SPI с помощью структуры \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Проверка корректности структуры инициализации SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Настройка тактирования и прерываний SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\+\_\+\+Msp\+De\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Заголовочный файл для модуля инициализации SPI.
|
||||
|
||||
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__spi_8h_source}{general\+\_\+spi.\+h}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
048ce4bd2d099fe77f43aaff2442a331
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h__dep__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h__dep__incl.pdf
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
e75f00a92afa1cd83d57b4f11f695fbd
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h__incl.pdf
Normal file
Binary file not shown.
177
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h_source.tex
Normal file
177
AllLibs/PeriphGeneral/Doc/latex/general__spi_8h_source.tex
Normal file
@@ -0,0 +1,177 @@
|
||||
\doxysection{general\+\_\+spi.\+h}
|
||||
\hypertarget{general__spi_8h_source}{}\label{general__spi_8h_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_spi.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_spi.h}}
|
||||
\mbox{\hyperlink{general__spi_8h}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_spi.h}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Заголовочный\ файл\ для\ модуля\ инициализации\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00006}00006\ \textcolor{comment}{*\ @defgroup\ GENERAL\_SPI\ \ \ \ \ \ SPI\ Tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ STM32\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00008}00008\ \textcolor{comment}{*\ @brief\ \ \ \ Функции\ и\ макросы\ для\ удобной\ работы\ с\ SPI.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00009}00009\ \textcolor{comment}{*\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00010}00010\ \textcolor{comment}{Модуль\ предоставляет\ функции\ для\ базовой\ инициализации\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00011}00011\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00012}00012\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00013}00013\ \textcolor{comment}{@par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00014}00014\ \textcolor{comment}{@code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00015}00015\ \textcolor{comment}{//\ Структура\ настроек\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00016}00016\ \textcolor{comment}{SPI\_SettingsTypeDef\ spi1Settings;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00017}00017\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00018}00018\ \textcolor{comment}{void\ SPI1\_Init(void)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00019}00019\ \textcolor{comment}{\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00020}00020\ \textcolor{comment}{\ \ \ \ //\ Настройка\ SPI1\ как\ Master,\ 8\ бит,\ полный\ дуплекс}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00021}00021\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Instance\ =\ SPI1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00022}00022\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.Mode\ =\ SPI\_MODE\_MASTER;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00023}00023\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.Direction\ =\ SPI\_DIRECTION\_2LINES;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00024}00024\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.DataSize\ =\ SPI\_DATASIZE\_8BIT;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00025}00025\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.CLKPolarity\ =\ SPI\_POLARITY\_LOW;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00026}00026\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.CLKPhase\ =\ SPI\_PHASE\_1EDGE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00027}00027\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.NSS\ =\ SPI\_NSS\_SOFT;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00028}00028\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.BaudRatePrescaler\ =\ SPI\_BAUDRATEPRESCALER\_16;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00029}00029\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.FirstBit\ =\ SPI\_FIRSTBIT\_MSB;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00030}00030\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.TIMode\ =\ SPI\_TIMODE\_DISABLE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00031}00031\ \textcolor{comment}{\ \ \ \ spi1Settings.hspi.Init.CRCCalculation\ =\ SPI\_CRCCALCULATION\_DISABLE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00032}00032\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00033}00033\ \textcolor{comment}{\ \ \ \ //\ Настройка\ GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00034}00034\ \textcolor{comment}{\ \ \ \ spi1Settings.CLK\_GPIOx\ =\ GPIOA;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00035}00035\ \textcolor{comment}{\ \ \ \ spi1Settings.CLK\_PIN\ =\ GPIO\_PIN\_5;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00036}00036\ \textcolor{comment}{\ \ \ \ spi1Settings.CLK\_GPIO\_AlternageFunc\ =\ GPIO\_AF5\_SPI1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00037}00037\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00038}00038\ \textcolor{comment}{\ \ \ \ spi1Settings.MISO\_GPIOx\ =\ GPIOA;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00039}00039\ \textcolor{comment}{\ \ \ \ spi1Settings.MISO\_PIN\ =\ GPIO\_PIN\_6;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00040}00040\ \textcolor{comment}{\ \ \ \ spi1Settings.MISO\_GPIO\_AlternageFunc\ =\ GPIO\_AF5\_SPI1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00041}00041\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00042}00042\ \textcolor{comment}{\ \ \ \ spi1Settings.MOSI\_GPIOx\ =\ GPIOA;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00043}00043\ \textcolor{comment}{\ \ \ \ spi1Settings.MOSI\_PIN\ =\ GPIO\_PIN\_7;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00044}00044\ \textcolor{comment}{\ \ \ \ spi1Settings.MOSI\_GPIO\_AlternageFunc\ =\ GPIO\_AF5\_SPI1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00045}00045\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00046}00046\ \textcolor{comment}{\ \ \ \ //\ Инициализация\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00047}00047\ \textcolor{comment}{\ \ \ \ if(SPI\_Base\_Init(\&spi1Settings)\ !=\ HAL\_OK)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00048}00048\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00049}00049\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Обработка\ ошибки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00050}00050\ \textcolor{comment}{\ \ \ \ \ \ \ \ Error\_Handler();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00051}00051\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00052}00052\ \textcolor{comment}{\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00053}00053\ \textcolor{comment}{@endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00054}00054\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00055}00055\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00056}00056\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00057}00057\ \textcolor{comment}{*\ \ @note\ Требуется\ подключение\ модуля\ SPI\ в\ библиотеке\ HAL\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00058}00058\ \textcolor{comment}{@code\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00059}00059\ \textcolor{comment}{\#define\ HAL\_SPI\_MODULE\_ENABLED}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00060}00060\ \textcolor{comment}{@endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00061}00061\ \textcolor{comment}{*\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00062}00062\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00063}00063\ \textcolor{preprocessor}{\#ifndef\ \_\_SPI\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00064}00064\ \textcolor{preprocessor}{\#define\ \_\_SPI\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00065}00065\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00066}00066\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00067}00067\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00068}00068\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00069}00069\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00070}00070\ \textcolor{comment}{\ \ *\ @addtogroup\ SPI\_INIT\ SPI\ Init\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00071}00071\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00072}00072\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_CONFIGS\ Конфигурации\ STM32\ General}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00073}00073\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Настройка\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00074}00074\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00075}00075\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00076}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga8ad4712bf4add56892d057778e826e0c}{00076}}\ \textcolor{preprocessor}{\#define\ HAL\_SPI\_MODULE\_ENABLED\ \ \ }\textcolor{comment}{///<\ Включение\ HAL\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00077}00077\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00078}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga2fe0c8aeb2c61679f32836fef479eedf}{00078}}\ \textcolor{preprocessor}{\#define\ USE\_SPI1\ \ \ \ }\textcolor{comment}{///<\ Включить\ SPI1\ в\ @ref\ SPI\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00079}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga53687cddb8e39e76a79b8ffaa152fb2b}{00079}}\ \textcolor{preprocessor}{\#define\ USE\_SPI2\ \ \ \ }\textcolor{comment}{///<\ Включить\ SPI2\ в\ @ref\ SPI\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00080}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga5fdd6e5934a8005ef05b80f6d95883dc}{00080}}\ \textcolor{preprocessor}{\#define\ USE\_SPI3\ \ \ \ }\textcolor{comment}{///<\ Включить\ SPI3\ в\ @ref\ SPI\_MspInit}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00081}00081\ \textcolor{comment}{/**\ SPI\_INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00082}00082\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00083}00083\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00084}00084\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00085}00085\ \textcolor{preprocessor}{\#include\ "{}mylibs\_defs.h"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00086}00086\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00087}00087\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00088}00088\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00089}00089\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00090}00090\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00091}00091\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00092}00092\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00093}00093\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00094}00094\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00095}00095\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00096}00096\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00097}00097\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00098}00098\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00099}00099\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00100}00100\ \textcolor{comment}{\ \ *\ @brief\ Структура\ настроек\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00101}00101\ \textcolor{comment}{\ \ *\ @details\ Содержит\ все\ необходимые\ параметры\ для\ инициализации\ SPI,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00102}00102\ \textcolor{comment}{\ \ *\ включая\ GPIO\ и\ DMA.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00103}00103\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00104}\mbox{\hyperlink{struct_s_p_i___settings_type_def}{00104}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00105}00105\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00106}\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{00106}}\ \ \ SPI\_HandleTypeDef\ \mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ HAL\ handle\ SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00107}00107\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00108}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{00108}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ CLK}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00109}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{00109}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{CLK\_PIN}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ CLK}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00110}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{00110}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{CLK\_GPIO\_AlternageFunc}};\ \ \ \textcolor{comment}{///<\ Альтернативная\ функция\ для\ CLK}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00111}00111\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00112}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{00112}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ MISO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00113}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{00113}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{MISO\_PIN}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ MISO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00114}\mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{00114}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{MISO\_GPIO\_AlternageFunc}};\ \ \textcolor{comment}{///<\ Альтернативная\ функция\ для\ MISO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00115}00115\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00116}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{00116}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ MOSI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00117}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{00117}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{MOSI\_PIN}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ MOSI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00118}\mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{00118}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{MOSI\_GPIO\_AlternageFunc}};\ \ \textcolor{comment}{///<\ Альтернативная\ функция\ для\ MOSI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00119}00119\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00120}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3cfd9469b0617a68bbd2a161ba06bb95}{00120}}\ \ \ DMA\_Stream\_TypeDef\ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3cfd9469b0617a68bbd2a161ba06bb95}{DMAChannel}};\ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Канал\ DMA\ (NULL\ если\ не\ нужен)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00121}\mbox{\hyperlink{struct_s_p_i___settings_type_def_aa0edaa145076d2383b3e0095d156d474}{00121}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_s_p_i___settings_type_def_aa0edaa145076d2383b3e0095d156d474}{DMA\_CHANNEL\_X}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Номер\ канала\ DMA\ (0\ если\ не\ нужен)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00122}00122\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00123}00123\ \}\ \mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}};\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00124}00124\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00125}00125\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00126}00126\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00127}00127\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00128}00128\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00129}00129\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00130}00130\ \textcolor{comment}{/*\ Инициализация\ SPI\ с\ использованием\ структуры\ настроек\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00131}00131\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\_Base\_Init}}(\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ *sspi);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00132}00132\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00133}00133\ \textcolor{comment}{/*\ Проверка\ корректности\ структуры\ настроек\ SPI\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00134}00134\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\_Check\_Init\_Struct}}(\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ *sspi);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00135}00135\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00136}00136\ \textcolor{comment}{/*\ Инициализация\ тактирования\ и\ прерываний\ для\ выбранного\ SPI\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00137}00137\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\_MspInit}}(SPI\_HandleTypeDef\ *hspi);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00138}00138\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00139}00139\ \textcolor{comment}{/*\ Деинициализация\ тактирования\ и\ прерываний\ для\ выбранного\ SPI\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00140}00140\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\_MspDeInit}}(SPI\_HandleTypeDef\ *hspi);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00141}00141\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00142}00142\ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00143}00143\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00144}00144\ \textcolor{comment}{\ *\ @cond\ SPI\_INTERNAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00145}00145\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00146}00146\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00147}00147\ \textcolor{comment}{/*\ Настройка\ GPIO\ для\ SPI\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00148}00148\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{general__spi_8c_ae80d21e5cab86571709a2619442733b5}{SPI\_GPIO\_Init}}(\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ *sspi);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00149}00149\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00150}00150\ \textcolor{comment}{/*\ Настройка\ DMA\ для\ SPI\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00151}00151\ \textcolor{keywordtype}{void}\ SPI\_DMA\_Init(SPI\_HandleTypeDef\ *hspi,\ DMA\_HandleTypeDef\ *hdma\_rx,\ DMA\_Stream\_TypeDef\ *DMAChannel,\ uint32\_t\ DMA\_CHANNEL\_X);}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00152}00152\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00153}00153\ \textcolor{preprocessor}{\#ifndef\ \_\_USER\_LINKDMA}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00154}00154\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00155}00155\ \textcolor{comment}{\ \ *\ @brief\ \ Аналог\ HAL\ макроса\ для\ привязки\ DMA\ к\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00156}00156\ \textcolor{comment}{\ \ *\ @note\ \ \ @ref\ \_\_HAL\_LINKDMA.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00157}00157\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00158}00158\ \textcolor{preprocessor}{\#define\ \_\_USER\_LINKDMA(\_\_HANDLE\_\_,\ \_\_PPP\_DMA\_FIELD\_\_,\ \_\_DMA\_HANDLE\_\_)\ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00159}00159\ \textcolor{preprocessor}{do\{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00160}00160\ \textcolor{preprocessor}{(\_\_HANDLE\_\_)-\/>\_\_PPP\_DMA\_FIELD\_\_\ =\ (\_\_DMA\_HANDLE\_\_);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00161}00161\ \textcolor{preprocessor}{(\_\_DMA\_HANDLE\_\_)-\/>Parent\ =\ (\_\_HANDLE\_\_);\}\ while(0U)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00162}00162\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00163}00163\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00164}00164\ \textcolor{comment}{/**\ @endcond\ */}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00165}00165\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00166}00166\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00167}00167\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_SPI\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00168}00168\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00169}00169\ \textcolor{comment}{/**\ GENERAL\_SPI}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00170}00170\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00171}00171\ \textcolor{comment}{\ \ */}}
|
||||
|
||||
\end{DoxyCode}
|
||||
54
AllLibs/PeriphGeneral/Doc/latex/general__tim_8c.tex
Normal file
54
AllLibs/PeriphGeneral/Doc/latex/general__tim_8c.tex
Normal file
@@ -0,0 +1,54 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/general\+\_\+tim.c File Reference}
|
||||
\hypertarget{general__tim_8c}{}\label{general__tim_8c}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_tim.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_tim.c}}
|
||||
|
||||
|
||||
Модуль для инициализации таймеров и работы с ними.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}general\+\_\+tim.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+tim.\+c\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=214pt]{general__tim_8c__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}stim)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\+\_\+\+Encoder\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc, TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация режима энкодер у таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\+\_\+\+Output\+\_\+\+PWM\+\_\+\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, TIM\+\_\+\+OC\+\_\+\+Init\+Type\+Def \texorpdfstring{$\ast$}{*}s\+Config\+OC, uint32\+\_\+t TIM\+\_\+\+CHANNEL, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация выхода ШИМ таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\+\_\+\+OC\+\_\+\+Comparator\+\_\+\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint32\+\_\+t TIM\+\_\+\+CHANNEL)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация OC компаратора таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\+\_\+\+Encoder\+\_\+\+Read}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
|
||||
\begin{DoxyCompactList}\small\item\em Считать энкодер. \end{DoxyCompactList}\item
|
||||
int \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\+\_\+\+Encoder\+\_\+\+Read\+Switch}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
|
||||
\begin{DoxyCompactList}\small\item\em Считать кнопку энкодера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\+\_\+\+Delay}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint16\+\_\+t delay)
|
||||
\begin{DoxyCompactList}\small\item\em Задержка в тиках таймера (блокирующая). \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\+\_\+\+Delay\+\_\+\+Start}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Начать отсчет неблокирующей задержки. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\+\_\+\+Delay\+\_\+\+Non\+Blocking}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint16\+\_\+t delay)
|
||||
\begin{DoxyCompactList}\small\item\em Задержка в тиках таймера (неблокирующая). \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}} it\+\_\+mode)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация CLK и NVIC таймеров. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{TIM\+\_\+\+Base\+\_\+\+Msp\+De\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация CLK и NVIC таймеров. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Модуль для инициализации таймеров и работы с ними.
|
||||
|
||||
Реализация функций для работы с TIM\+:
|
||||
\begin{DoxyItemize}
|
||||
\item Инициализация таймера и его каналов
|
||||
\item Формирование задержек через таймеры
|
||||
\item Считывание энкодера
|
||||
\end{DoxyItemize}
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
bdeb54554710242ead0de83d18f0da10
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__tim_8c__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__tim_8c__incl.pdf
Normal file
Binary file not shown.
728
AllLibs/PeriphGeneral/Doc/latex/general__tim_8c_source.tex
Normal file
728
AllLibs/PeriphGeneral/Doc/latex/general__tim_8c_source.tex
Normal file
@@ -0,0 +1,728 @@
|
||||
\doxysection{general\+\_\+tim.\+c}
|
||||
\hypertarget{general__tim_8c_source}{}\label{general__tim_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_tim.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_tim.c}}
|
||||
\mbox{\hyperlink{general__tim_8c}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_tim.c}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Модуль\ для\ инициализации\ таймеров\ и\ работы\ с\ ними.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00006}00006\ \textcolor{comment}{Реализация\ функций\ для\ работы\ с\ TIM:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00007}00007\ \textcolor{comment}{\ -\/\ Инициализация\ таймера\ и\ его\ каналов}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00008}00008\ \textcolor{comment}{\ -\/\ Формирование\ задержек\ через\ таймеры}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00009}00009\ \textcolor{comment}{\ -\/\ Считывание\ энкодера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00010}00010\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00011}00011\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__tim_8h}{general\_tim.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00012}00012\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00013}00013\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00014}00014\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00015}00015\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00016}00016\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00017}00017\ \textcolor{comment}{\ \ *\ @param\ \ stim\ Указатель\ на\ структуру\ с\ настройками\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00018}00018\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00019}00019\ \textcolor{comment}{\ \ *\ @details\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00020}00020\ \textcolor{comment}{\ \ *\ Инициализирует\ таймер\ исходя\ из\ настроек\ верхнего\ уровня:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00021}00021\ \textcolor{comment}{\ \ *\ -\/\ Длительность\ одного\ тика\ @ref\ TIM\_MHzTickBaseTypeDef}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00022}00022\ \textcolor{comment}{\ \ *\ -\/\ Частота\ таймера\ (в\ Гц,\ float)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00023}00023\ \textcolor{comment}{\ \ *\ -\/\ Частота\ тактирования\ таймера\ от\ шины\ (в\ Гц,\ float)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00024}00024\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00025}00025\ \textcolor{comment}{\ \ *\ При\ невозможности\ выставления\ частоты\ при\ заданой\ длительности\ тика}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00026}00026\ \textcolor{comment}{\ \ *\ длительность\ тика\ увеличивается\ до\ тех\ пор,\ пока\ частота\ не\ будет\ достигнута.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00027}00027\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00028}00028\ \textcolor{comment}{\ \ *\ При\ выставлении\ дефайна\ @ref\ UPDATE\_TIM\_PARAMS\_AFTER\_INITIALIZATION}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00029}00029\ \textcolor{comment}{\ \ *\ новая\ длительность\ тика\ записывается\ в\ структуру.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00030}00030\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00031}00031\ \textcolor{comment}{\ \ *\ Также\ остается\ возможность\ низкоуровневой\ настройки\ по\ структурам\ @ref\ TIM\_SettingsTypeDef.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00032}00032\ \textcolor{comment}{\ \ *\ Для\ этого\ надо\ высокоуровневые\ настройки\ приравнять\ к\ нулю}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00033}00033\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00034}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{00034}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\_Base\_Init}}(\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}}\ *stim)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00035}00035\ \{\ \textcolor{comment}{//\ function\ takes\ structure\ for\ init}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00036}00036\ \ \ \textcolor{comment}{//\ check\ that\ htim\ is\ defined}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00037}00037\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(stim,\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00038}00038\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00039}00039\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00040}00040\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00041}00041\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00042}00042\ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}})\ \textcolor{comment}{//\ if\ tickbase\ isnt\ disable}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00043}00043\ \ \ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00044}00044\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}\ ==\ NULL)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00045}00045\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00046}00046\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}*stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}})\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00047}00047\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00048}00048\ \ \ \ \ \textcolor{keywordflow}{if}\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{sTimFreqHz}}\ !=\ NULL))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00049}00049\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ ((1000000/stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}})\ /\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{sTimFreqHz}})\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00050}00050\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ ==\ NULL)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00051}00051\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ 0xFFFF;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00052}00052\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00053}00053\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00054}00054\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00055}00055\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ +\ 1)/stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00056}00056\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ \ \ \ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ +\ 1)*stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00057}00057\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00058}00058\ \ \ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00059}00059\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ =\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00060}00060\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00061}00061\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00062}00062\ \ \ \textcolor{comment}{//\ fix\ overflow\ of\ presc\ and\ period\ if\ need}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00063}00063\ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ i\ =\ 0;\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ >\ 0xFFFF)\ ||\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ >\ 0xFFFF);\ i++)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00064}00064\ \ \ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00065}00065\ \ \ \ \ \textcolor{keywordflow}{if}\ (i>10)\ \textcolor{comment}{//\ if\ it\ isnt\ fixed\ after\ 10\ itteration\ -\/\ return\ HAL\_ERRPOR}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00066}00066\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00067}00067\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00068}00068\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00069}00069\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00070}00070\ \ \ \ \ \textcolor{comment}{//\ if\ timbase\ is\ too\ big\ (prescaller\ too\ big\ for\ choosen\ base\ from\ MHZ)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00071}00071\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ >\ 0xFFFF)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00072}00072\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00073}00073\ \ \ \ \ \ \ \textcolor{comment}{//\ переносим\ часть\ пресскалера\ в\ период}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00074}00074\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ +\ 1)/2)\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00075}00075\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ +\ 1)*2)\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00076}00076\ \ \ \ \ \ \ \textcolor{comment}{//\ обновляем\ TickBase,\ если\ есть\ куда\ обновлять}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00077}00077\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ >\ 1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00078}00078\ \ \ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ /=\ 2;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00079}00079\ \ \ \ \ \ \ \textcolor{comment}{//\ обновляем\ sTickBasePrescaler,\ если\ sTickBaseUS\ -\/\ уже\ в\ минимуме}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00080}00080\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ ==\ 1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00081}00081\ \ \ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ *=\ 2;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00082}00082\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{comment}{//\ if\ TickBase\ =\ 0\ -\/\ return\ error}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00083}00083\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00084}00084\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00085}00085\ \ \ \ \ \textcolor{comment}{//\ if\ freq\ is\ too\ low\ (period\ too\ big\ for\ choosen\ base)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00086}00086\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ >\ 0xFFFF)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00087}00087\ \ \ \ \ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00088}00088\ \ \ \ \ \ \ \textcolor{comment}{//\ переносим\ часть\ периода\ в\ прескалер}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00089}00089\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ +\ 1)/2)\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00090}00090\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ +\ 1)*2)\ -\/\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00091}00091\ \ \ \ \ \ \ \textcolor{comment}{//\ обновляем\ TickBase}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00092}00092\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ *=\ 2;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00093}00093\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00094}00094\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00095}00095\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00096}00096\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ BASE\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00097}00097\ \ \ \textcolor{comment}{//\ tim\ base\ init\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00098}00098\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\_Base\_MspInit}}(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ab90e370c3edda88e76583293c250d2b0}{sTimMode}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00099}00099\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIM\_Base\_Init(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00100}00100\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00101}00101\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00102}00102\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00103}00103\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00104}00104\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00105}00105\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CLOCK\ SRC\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00106}00106\ \ \ \textcolor{comment}{//\ fill\ sClockSourceConfig\ if\ its\ NULL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00107}00107\ \ \ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}}.ClockSource\ ==\ NULL)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00108}00108\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}}.ClockSource\ =\ TIM\_CLOCKSOURCE\_INTERNAL;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00109}00109\ \ \ \textcolor{comment}{//\ clock\ source\ init\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00110}00110\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIM\_ConfigClockSource(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00111}00111\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00112}00112\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00113}00113\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00114}00114\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00115}00115\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00116}00116\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/SLAVE\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00117}00117\ \ \ \textcolor{comment}{//\ if\ slave\ mode\ enables\ -\/\ config\ it}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00118}00118\ \ \ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a9694cf0910a69d48ff94f8aeac106969}{sSlaveConfig}}.SlaveMode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00119}00119\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00120}00120\ \ \ \ \ \textcolor{comment}{//\ slave\ mode\ init\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00121}00121\ \ \ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIM\_SlaveConfigSynchro(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a9694cf0910a69d48ff94f8aeac106969}{sSlaveConfig}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00122}00122\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00123}00123\ \ \ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00124}00124\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00125}00125\ \ \ \ \ \}\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00126}00126\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00127}00127\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/MASTER\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00128}00128\ \ \ \textcolor{comment}{//\ master\ mode\ init\ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00129}00129\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIMEx\_MasterConfigSynchronization(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a2d9d277dd395424b964445ec1bc65b21}{sMasterConfig}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00130}00130\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00131}00131\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00132}00132\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00133}00133\ \ \ \}\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00134}00134\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00135}00135\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/BDTR\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00136}00136\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIMEx\_ConfigBreakDeadTime(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a961f19f0e1672715c27bc94d7871dbb7}{sBreakDeadTimeConfig}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00137}00137\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00138}00138\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00139}00139\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00140}00140\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00141}00141\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00142}00142\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/IT\ CLEAR-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00143}00143\ \ \ \_\_HAL\_TIM\_CLEAR\_IT(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ TIM\_IT\_UPDATE);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00144}00144\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00145}00145\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00146}00146\ \ \ \textcolor{comment}{//\ обновляем\ TickBase}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00147}00147\ \textcolor{preprocessor}{\ \ \#ifdef\ UPDATE\_TIM\_PARAMS\_AFTER\_INITIALIZATION}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00148}00148\ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance-\/>PSC+1)*stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}/(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00149}00149\ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ ==\ 0)\ \ \textcolor{comment}{//\ if\ prescaler\ is\ too\ high}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00150}00150\ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ recalc\ what\ is\ prescaler\ irl}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00151}00151\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ =\ 1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00152}00152\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ =\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}/(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance-\/>PSC+1);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00153}00153\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00154}00154\ \textcolor{preprocessor}{\ \ \#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00155}00155\ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance-\/>CNT\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00156}00156\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00157}00157\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00158}00158\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00159}00159\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00160}00160\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00161}00161\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00162}00162\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ режима\ энкодер\ у\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00163}00163\ \textcolor{comment}{\ \ *\ @param\ \ henc\ Указатель\ на\ хендл\ энкодера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00164}00164\ \textcolor{comment}{\ \ *\ @param\ \ htim\ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00165}00165\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00166}00166\ \textcolor{comment}{\ \ *\ @note\ \ \ Предварительно\ надо\ инициализировать\ таймер\ @ref\ TIM\_Base\_Init.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00167}00167\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00168}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{00168}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\_Encoder\_Init}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc,\ TIM\_HandleTypeDef\ *htim)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00169}00169\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00170}00170\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(henc,\ htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00171}00171\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00172}00172\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00173}00173\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00174}00174\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00175}00175\ \ \ GPIO\_InitTypeDef\ GPIO\_InitStruct\ =\ \{0\};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00176}00176\ \ \ HAL\_StatusTypeDef\ RES\ =\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00177}00177\ \ \ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}\ =\ htim;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00178}00178\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00179}00179\ \ \ \textcolor{comment}{//\ setup\ channel\ for\ pwm}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00180}00180\ \ \ RES\ =\ HAL\_TIM\_Encoder\_Init(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}},\ \&henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a021f0c585e9e62d68a4b09f630d8b6e5}{sConfig}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00181}00181\ \ \ \textcolor{keywordflow}{if}\ (RES\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00182}00182\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00183}00183\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00184}00184\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00185}00185\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00186}00186\ \ \ \textcolor{comment}{//\ choose\ port\ for\ enable\ clock}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00187}00187\ \ \ RES\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00188}00188\ \ \ \textcolor{keywordflow}{if}(RES\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00189}00189\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00190}00190\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00191}00191\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00192}00192\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00193}00193\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00194}00194\ \ \ GPIO\_InitStruct.Pin\ =\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}}|henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00195}00195\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00196}00196\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLUP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00197}00197\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_LOW;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00198}00198\ \ \ GPIO\_InitStruct.Alternate\ =\ GPIO\_TIM\_Alternate\_Mapping(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}-\/>Instance);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00199}00199\ \ \ \textcolor{keywordflow}{if}(GPIO\_InitStruct.Alternate)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00200}00200\ \ \ \ \ HAL\_GPIO\_Init(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00201}00201\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00202}00202\ \ \ \textcolor{keywordflow}{if}(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}})}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00203}00203\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00204}00204\ \ \ \ \ \textcolor{comment}{/*Configure\ switch\ pin\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00205}00205\ \ \ \ \ GPIO\_InitStruct.Pin\ =\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00206}00206\ \ \ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_INPUT;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00207}00207\ \ \ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLUP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00208}00208\ \ \ \ \ HAL\_GPIO\_Init(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00209}00209\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00210}00210\ \ \ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\_Switch\_Init}}(\&henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a99295760ff8b27d1e6f1710f29383a45}{Sw}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}},\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00211}00211\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00212}00212\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00213}00213\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00214}00214\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00215}00215\ \ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00216}00216\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00217}00217\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ выхода\ ШИМ\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00218}00218\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ \ \ \ \ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00219}00219\ \textcolor{comment}{\ \ *\ @param\ \ sConfigOC\ \ \ Указатель\ на\ настрйоки\ канала\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00220}00220\ \textcolor{comment}{\ \ *\ @param\ \ TIM\_CHANNEL\ Канал\ таймера\ для\ настройки.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00221}00221\ \textcolor{comment}{\ \ *\ @param\ \ GPIOx\ \ \ \ \ \ \ Порт\ для\ вывода\ ШИМ.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00222}00222\ \textcolor{comment}{\ \ *\ @param\ \ GPIO\_PIN\ \ \ \ Пин\ для\ вывода\ ШИМ.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00223}00223\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00224}00224\ \textcolor{comment}{\ \ *\ @note\ \ \ Предварительно\ надо\ инициализировать\ таймер\ @ref\ TIM\_Base\_Init.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00225}00225\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00226}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{00226}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\_Output\_PWM\_Init}}(TIM\_HandleTypeDef\ *htim,\ TIM\_OC\_InitTypeDef\ *sConfigOC,\ uint32\_t\ TIM\_CHANNEL,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ GPIO\_PIN)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00227}00227\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00228}00228\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(htim,\ htim-\/>Instance,\ sConfigOC))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00229}00229\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00230}00230\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(GPIOx,\ GPIO\_PIN))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00231}00231\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00232}00232\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00233}00233\ \ \ GPIO\_InitTypeDef\ GPIO\_InitStruct\ =\ \{0\};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00234}00234\ \ \ HAL\_StatusTypeDef\ RES\ =\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00235}00235\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00236}00236\ \ \ \textcolor{comment}{//\ setup\ channel\ for\ pwm}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00237}00237\ \ \ RES\ =\ HAL\_TIM\_PWM\_ConfigChannel(htim,\ sConfigOC,\ TIM\_CHANNEL);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00238}00238\ \ \ \textcolor{keywordflow}{if}\ (RES\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00239}00239\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00240}00240\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00241}00241\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00242}00242\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00243}00243\ \ \ \textcolor{comment}{//\ choose\ port\ for\ enable\ clock}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00244}00244\ \ \ RES\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(GPIOx);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00245}00245\ \ \ \textcolor{keywordflow}{if}(RES\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00246}00246\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00247}00247\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00248}00248\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00249}00249\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00250}00250\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00251}00251\ \ \ GPIO\_InitStruct.Pin\ =\ GPIO\_PIN;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00252}00252\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00253}00253\ \ \ \textcolor{keywordflow}{if}(sConfigOC-\/>OCPolarity\ ==\ TIM\_OCNPOLARITY\_HIGH)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00254}00254\ \ \ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLDOWN;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00255}00255\ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00256}00256\ \ \ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLUP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00257}00257\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_LOW;\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00258}00258\ \ \ GPIO\_InitStruct.Alternate\ =\ GPIO\_TIM\_Alternate\_Mapping(htim-\/>Instance);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00259}00259\ \ \ \textcolor{keywordflow}{if}(GPIO\_InitStruct.Alternate)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00260}00260\ \ \ \ \ HAL\_GPIO\_Init(GPIOx,\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00261}00261\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00262}00262\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00263}00263\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00264}00264\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00265}00265\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00266}00266\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ OC\ компаратора\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00267}00267\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ \ \ \ \ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00268}00268\ \textcolor{comment}{\ \ *\ @param\ \ TIM\_CHANNEL\ Канал\ таймера\ для\ настройки.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00269}00269\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00270}00270\ \textcolor{comment}{\ \ *\ @note\ \ \ Предварительно\ надо\ инициализировать\ таймер\ @ref\ TIM\_Base\_Init.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00271}00271\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00272}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{00272}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\_OC\_Comparator\_Init}}(TIM\_HandleTypeDef\ *htim,\ uint32\_t\ TIM\_CHANNEL)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00273}00273\ \{\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00274}00274\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00275}00275\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00276}00276\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00277}00277\ \ \ TIM\_OC\_InitTypeDef\ \ \ \ \ \ sConfigOC\ =\ \{0\};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00278}00278\ \ \ HAL\_StatusTypeDef\ RES\ =\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00279}00279\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00280}00280\ \ \ sConfigOC.OCMode\ =\ TIM\_OCMODE\_ACTIVE;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00281}00281\ \ \ sConfigOC.Pulse\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00282}00282\ \ \ sConfigOC.OCPolarity\ =\ TIM\_OCPOLARITY\_HIGH;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00283}00283\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00284}00284\ \ \ RES\ =\ HAL\_TIM\_OC\_ConfigChannel(htim,\ \&sConfigOC,\ TIM\_CHANNEL);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00285}00285\ \ \ \textcolor{keywordflow}{if}\ (RES\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00286}00286\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00287}00287\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00288}00288\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00289}00289\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00290}00290\ \ \ \textcolor{keywordflow}{return}\ RES;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00291}00291\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00292}00292\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00293}00293\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00294}00294\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00295}00295\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ USER\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00296}00296\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00297}00297\ \textcolor{comment}{\ \ *\ @brief\ \ Считать\ энкодер.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00298}00298\ \textcolor{comment}{\ \ *\ @param\ \ henc\ Указатель\ на\ хендл\ энкодера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00299}00299\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00300}00300\ \textcolor{comment}{\ \ *\ @details\ \ Читает\ разницу\ энкодера,\ которую\ он\ накопил\ после\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00301}00301\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ предыдущего\ вызова\ этой\ функции.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00302}00302\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00303}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{00303}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\_Encoder\_Read}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00304}00304\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00305}00305\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(henc,\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00306}00306\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00307}00307\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00308}00308\ \ \ uint16\_t\ cnt\_now\ =\ (uint16\_t)henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}-\/>Instance-\/>CNT;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00309}00309\ \ \ int16\_t\ diff\ =\ (int16\_t)(cnt\_now\ -\/\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a0dacce3dde7df3122583869d96a372a2}{Encoder\_Shdw}});\ \ \textcolor{comment}{//\ переполнение\ корректно\ обрабатывается}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00310}00310\ \ \ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6f769f027b760a4b496e2b2b77bf54a3}{Encoder\_Diff}}\ =\ diff;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00311}00311\ \ \ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a0dacce3dde7df3122583869d96a372a2}{Encoder\_Shdw}}\ =\ cnt\_now;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00312}00312\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00313}00313\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00314}00314\ \}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00315}00315\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00316}00316\ \textcolor{comment}{\ \ *\ @brief\ \ Считать\ кнопку\ энкодера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00317}00317\ \textcolor{comment}{\ \ *\ @param\ \ henc\ Указатель\ на\ хендл\ энкодера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00318}00318\ \textcolor{comment}{\ \ *\ @return\ 1\ -\/\ если\ кнопка\ нажата,\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00319}00319\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ 0\ -\/\ если\ отжата,\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00320}00320\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ -\/1\ -\/\ если\ ошибка}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00321}00321\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00322}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{00322}}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\_Encoder\_ReadSwitch}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00323}00323\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00324}00324\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_1(henc))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00325}00325\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00326}00326\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00327}00327\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\_Read\_Switch}}(\&henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a99295760ff8b27d1e6f1710f29383a45}{Sw}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00328}00328\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00329}00329\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00330}00330\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00331}00331\ \textcolor{comment}{\ \ *\ @brief\ \ Задержка\ в\ тиках\ таймера\ (блокирующая).}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00332}00332\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00333}00333\ \textcolor{comment}{\ \ *\ @param\ \ delay\ \ \ Задержка\ в\ тиках\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00334}00334\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00335}00335\ \textcolor{comment}{\ \ *\ @details\ \ Формирует\ задержку\ с\ блокировкой\ программы.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00336}00336\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00337}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{00337}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\_Delay}}(TIM\_HandleTypeDef\ *htim,\ uint16\_t\ delay)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00338}00338\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00339}00339\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00340}00340\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00341}00341\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00342}00342\ \ \ \textcolor{keywordflow}{if}(delay\ >=\ htim-\/>Instance-\/>ARR)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00343}00343\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00344}00344\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00345}00345\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00346}00346\ \ \ htim-\/>Instance-\/>CNT\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00347}00347\ \ \ \textcolor{keywordflow}{while}(1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00348}00348\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00349}00349\ \ \ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance-\/>CNT\ >\ delay)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00350}00350\ \ \ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00351}00351\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00352}00352\ \ \ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00353}00353\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00354}00354\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00355}00355\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00356}00356\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00357}00357\ \textcolor{comment}{\ \ *\ @brief\ \ Начать\ отсчет\ неблокирующей\ задержки.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00358}00358\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00359}00359\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00360}00360\ \textcolor{comment}{\ \ *\ @details\ \ Сбрасывает\ счетчик\ для\ начала\ отсчета\ неблокирующей\ задержки.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00361}00361\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ @ref\ TIM\_Delay\_NonBlocking\ для\ проверки\ статуса\ задержки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00362}00362\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00363}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{00363}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\_Delay\_Start}}(TIM\_HandleTypeDef\ *htim)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00364}00364\ \{\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00365}00365\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00366}00366\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00367}00367\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00368}00368\ \ \ htim-\/>Instance-\/>CNT\ =\ 0;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00369}00369\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00370}00370\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00371}00371\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00372}00372\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00373}00373\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00374}00374\ \textcolor{comment}{\ \ *\ @brief\ \ Задержка\ в\ тиках\ таймера\ (неблокирующая).}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00375}00375\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00376}00376\ \textcolor{comment}{\ \ *\ @param\ \ delay\ \ \ Задержка\ в\ тиках\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00377}00377\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00378}00378\ \textcolor{comment}{\ \ *\ @details\ \ Формирует\ задержку\ с\ блокировкой\ программы.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00379}00379\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ Перед\ ожиданием\ задержки\ надо\ запутстить\ таймер\ @ref\ TIM\_Delay\_Start}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00380}00380\ \textcolor{comment}{\ \ *\ @note\ \ \ \ \ Таймер\ не\ должен\ использоваться\ на\ время\ этой\ задержки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00381}00381\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00382}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{00382}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\_Delay\_NonBlocking}}(TIM\_HandleTypeDef\ *htim,\ uint16\_t\ delay)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00383}00383\ \{\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00384}00384\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00385}00385\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00386}00386\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00387}00387\ \ \ \textcolor{keywordflow}{if}(delay\ >=\ htim-\/>Instance-\/>ARR)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00388}00388\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00389}00389\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00390}00390\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00391}00391\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00392}00392\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance-\/>CNT\ <=\ delay)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00393}00393\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00394}00394\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_BUSY;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00395}00395\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00396}00396\ \ \ \textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00397}00397\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00398}00398\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00399}00399\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00400}00400\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00401}00401\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00402}00402\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00403}00403\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ CLK\ и\ NVIC\ таймеров.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00404}00404\ \textcolor{comment}{\ \ *\ @param\ \ htim\ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00405}00405\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ иницилизацией\ неиспользуемых\ таймеров,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00406}00406\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ TIM\_INIT\ в\ @ref\ general\_tim.h\ определяются\ используемые\ таймеры.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00407}00407\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00408}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{00408}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\_Base\_MspInit}}(TIM\_HandleTypeDef*\ htim,\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\_ITModeTypeDef}}\ it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00409}00409\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00410}00410\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00411}00411\ \ \ \ \ \textcolor{keywordflow}{return};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00412}00412\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00413}00413\ \ \ it\_mode\ =\ it\_mode\&TIM\_IT\_CONF;}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00414}00414\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00415}00415\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00416}00416\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00417}00417\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00418}00418\ \ \ \ \ \_\_HAL\_RCC\_TIM1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00419}00419\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00420}00420\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00421}00421\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00422}00422\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00423}00423\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_UP\_TIM10\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00424}00424\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_UP\_TIM10\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00425}00425\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00426}00426\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00427}00427\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00428}00428\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00429}00429\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM2)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00430}00430\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00431}00431\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00432}00432\ \ \ \ \ \_\_HAL\_RCC\_TIM2\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00433}00433\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00434}00434\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00435}00435\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00436}00436\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00437}00437\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM2\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00438}00438\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM2\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00439}00439\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00440}00440\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00441}00441\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00442}00442\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00443}00443\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM3)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00444}00444\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00445}00445\ \ \ \ \ \textcolor{comment}{/*\ TIM3\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00446}00446\ \ \ \ \ \_\_HAL\_RCC\_TIM3\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00447}00447\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00448}00448\ \ \ \ \ \textcolor{comment}{/*\ TIM3\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00449}00449\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00450}00450\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00451}00451\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM3\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00452}00452\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM3\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00453}00453\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00454}00454\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00455}00455\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00456}00456\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00457}00457\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM4)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00458}00458\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00459}00459\ \ \ \ \ \textcolor{comment}{/*\ TIM4\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00460}00460\ \ \ \ \ \_\_HAL\_RCC\_TIM4\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00461}00461\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00462}00462\ \ \ \ \ \textcolor{comment}{/*\ TIM4\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00463}00463\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00464}00464\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00465}00465\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM4\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00466}00466\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM4\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00467}00467\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00468}00468\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00469}00469\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00470}00470\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00471}00471\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM5)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00472}00472\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00473}00473\ \ \ \ \ \textcolor{comment}{/*\ TIM5\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00474}00474\ \ \ \ \ \_\_HAL\_RCC\_TIM5\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00475}00475\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00476}00476\ \ \ \ \ \textcolor{comment}{/*\ TIM5\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00477}00477\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00478}00478\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00479}00479\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM5\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00480}00480\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM5\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00481}00481\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00482}00482\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00483}00483\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00484}00484\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM6}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00485}00485\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM6)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00486}00486\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00487}00487\ \ \ \ \ \textcolor{comment}{/*\ TIM6\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00488}00488\ \ \ \ \ \_\_HAL\_RCC\_TIM6\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00489}00489\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00490}00490\ \ \ \ \ \textcolor{comment}{/*\ TIM6\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00491}00491\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00492}00492\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00493}00493\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM6\_DAC\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00494}00494\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM6\_DAC\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00495}00495\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00496}00496\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00497}00497\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00498}00498\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM7}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00499}00499\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM7)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00500}00500\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00501}00501\ \ \ \ \ \textcolor{comment}{/*\ TIM7\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00502}00502\ \ \ \ \ \_\_HAL\_RCC\_TIM7\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00503}00503\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00504}00504\ \ \ \ \ \textcolor{comment}{/*\ TIM7\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00505}00505\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00506}00506\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00507}00507\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM7\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00508}00508\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM7\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00509}00509\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00510}00510\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00511}00511\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00512}00512\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM8}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00513}00513\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM8)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00514}00514\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00515}00515\ \ \ \ \ \textcolor{comment}{/*\ TIM8\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00516}00516\ \ \ \ \ \_\_HAL\_RCC\_TIM8\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00517}00517\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00518}00518\ \ \ \ \ \textcolor{comment}{/*\ TIM8\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00519}00519\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00520}00520\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00521}00521\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_UP\_TIM13\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00522}00522\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_UP\_TIM13\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00523}00523\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00524}00524\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00525}00525\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00526}00526\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM9}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00527}00527\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM9)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00528}00528\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00529}00529\ \ \ \ \ \textcolor{comment}{/*\ TIM9\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00530}00530\ \ \ \ \ \_\_HAL\_RCC\_TIM9\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00531}00531\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00532}00532\ \ \ \ \ \textcolor{comment}{/*\ TIM9\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00533}00533\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00534}00534\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00535}00535\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_BRK\_TIM9\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00536}00536\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_BRK\_TIM9\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00537}00537\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00538}00538\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00539}00539\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00540}00540\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM10}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00541}00541\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM10)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00542}00542\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00543}00543\ \ \ \ \ \textcolor{comment}{/*\ TIM10\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00544}00544\ \ \ \ \ \_\_HAL\_RCC\_TIM10\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00545}00545\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00546}00546\ \ \ \ \ \textcolor{comment}{/*\ TIM10\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00547}00547\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00548}00548\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00549}00549\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_UP\_TIM10\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00550}00550\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_UP\_TIM10\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00551}00551\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00552}00552\ \ \ \}\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00553}00553\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00554}00554\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM11}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00555}00555\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM11)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00556}00556\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00557}00557\ \ \ \ \ \textcolor{comment}{/*\ TIM11\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00558}00558\ \ \ \ \ \_\_HAL\_RCC\_TIM11\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00559}00559\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00560}00560\ \ \ \ \ \textcolor{comment}{/*\ TIM11\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00561}00561\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00562}00562\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00563}00563\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_TRG\_COM\_TIM11\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00564}00564\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_TRG\_COM\_TIM11\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00565}00565\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00566}00566\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00567}00567\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00568}00568\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM12}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00569}00569\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM12)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00570}00570\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00571}00571\ \ \ \ \ \textcolor{comment}{/*\ TIM12\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00572}00572\ \ \ \ \ \_\_HAL\_RCC\_TIM12\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00573}00573\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00574}00574\ \ \ \ \ \textcolor{comment}{/*\ TIM12\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00575}00575\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00576}00576\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00577}00577\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_BRK\_TIM12\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00578}00578\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_BRK\_TIM12\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00579}00579\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00580}00580\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00581}00581\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00582}00582\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM13}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00583}00583\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM13)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00584}00584\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00585}00585\ \ \ \ \ \textcolor{comment}{/*\ TIM13\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00586}00586\ \ \ \ \ \_\_HAL\_RCC\_TIM13\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00587}00587\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00588}00588\ \ \ \ \ \textcolor{comment}{/*\ TIM13\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00589}00589\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00590}00590\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00591}00591\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_UP\_TIM13\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00592}00592\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_UP\_TIM13\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00593}00593\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00594}00594\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00595}00595\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00596}00596\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM14}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00597}00597\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM14)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00598}00598\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00599}00599\ \ \ \ \ \textcolor{comment}{/*\ TIM14\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00600}00600\ \ \ \ \ \_\_HAL\_RCC\_TIM14\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00601}00601\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00602}00602\ \ \ \ \ \textcolor{comment}{/*\ TIM14\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00603}00603\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00604}00604\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00605}00605\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_TRG\_COM\_TIM14\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00606}00606\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_TRG\_COM\_TIM14\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00607}00607\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00608}00608\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00609}00609\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00610}00610\ \}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00611}00611\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00612}00612\ \textcolor{comment}{\ \ *\ @brief\ \ Деинициализация\ CLK\ и\ NVIC\ таймеров.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00613}00613\ \textcolor{comment}{\ \ *\ @param\ \ htim\ Указатель\ на\ хендл\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00614}00614\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ деиницилизацией\ неиспользуемых\ таймеров,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00615}00615\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ TIM\_INIT\ в\ @ref\ general\_tim.h\ определяются\ используемые\ таймеры.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00616}00616\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00617}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{00617}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{TIM\_Base\_MspDeInit}}(TIM\_HandleTypeDef*\ htim)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00618}00618\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00619}00619\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00620}00620\ \ \ \ \ \textcolor{keywordflow}{return};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00621}00621\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00622}00622\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00623}00623\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00624}00624\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00625}00625\ \ \ \ \ \_\_HAL\_RCC\_TIM1\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00626}00626\ \ \ \ \ \_\_HAL\_RCC\_TIM1\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00627}00627\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00628}00628\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00629}00629\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00630}00630\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM2)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00631}00631\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00632}00632\ \ \ \ \ \_\_HAL\_RCC\_TIM2\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00633}00633\ \ \ \ \ \_\_HAL\_RCC\_TIM2\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00634}00634\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00635}00635\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00636}00636\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00637}00637\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM3)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00638}00638\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00639}00639\ \ \ \ \ \_\_HAL\_RCC\_TIM3\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00640}00640\ \ \ \ \ \_\_HAL\_RCC\_TIM3\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00641}00641\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00642}00642\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00643}00643\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00644}00644\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM4)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00645}00645\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00646}00646\ \ \ \ \ \_\_HAL\_RCC\_TIM4\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00647}00647\ \ \ \ \ \_\_HAL\_RCC\_TIM4\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00648}00648\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00649}00649\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00650}00650\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00651}00651\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM5)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00652}00652\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00653}00653\ \ \ \ \ \_\_HAL\_RCC\_TIM5\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00654}00654\ \ \ \ \ \_\_HAL\_RCC\_TIM5\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00655}00655\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00656}00656\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00657}00657\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM6}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00658}00658\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM6)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00659}00659\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00660}00660\ \ \ \ \ \_\_HAL\_RCC\_TIM6\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00661}00661\ \ \ \ \ \_\_HAL\_RCC\_TIM6\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00662}00662\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00663}00663\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00664}00664\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM7}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00665}00665\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM7)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00666}00666\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00667}00667\ \ \ \ \ \_\_HAL\_RCC\_TIM7\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00668}00668\ \ \ \ \ \_\_HAL\_RCC\_TIM7\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00669}00669\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00670}00670\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00671}00671\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM8}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00672}00672\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM8)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00673}00673\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00674}00674\ \ \ \ \ \_\_HAL\_RCC\_TIM8\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00675}00675\ \ \ \ \ \_\_HAL\_RCC\_TIM8\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00676}00676\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00677}00677\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00678}00678\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM9}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00679}00679\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM9)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00680}00680\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00681}00681\ \ \ \ \ \_\_HAL\_RCC\_TIM9\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00682}00682\ \ \ \ \ \_\_HAL\_RCC\_TIM9\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00683}00683\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00684}00684\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00685}00685\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM10}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00686}00686\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM10)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00687}00687\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00688}00688\ \ \ \ \ \_\_HAL\_RCC\_TIM10\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00689}00689\ \ \ \ \ \_\_HAL\_RCC\_TIM10\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00690}00690\ \ \ \}\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00691}00691\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00692}00692\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM11}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00693}00693\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM11)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00694}00694\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00695}00695\ \ \ \ \ \_\_HAL\_RCC\_TIM11\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00696}00696\ \ \ \ \ \_\_HAL\_RCC\_TIM11\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00697}00697\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00698}00698\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00699}00699\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM12}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00700}00700\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM12)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00701}00701\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00702}00702\ \ \ \ \ \_\_HAL\_RCC\_TIM12\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00703}00703\ \ \ \ \ \_\_HAL\_RCC\_TIM12\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00704}00704\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00705}00705\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00706}00706\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM13}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00707}00707\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM13)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00708}00708\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00709}00709\ \ \ \ \ \_\_HAL\_RCC\_TIM13\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00710}00710\ \ \ \ \ \_\_HAL\_RCC\_TIM13\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00711}00711\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00712}00712\ \textcolor{preprocessor}{\#endif\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00713}00713\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM14}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00714}00714\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM14)}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00715}00715\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00716}00716\ \ \ \ \ \_\_HAL\_RCC\_TIM14\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00717}00717\ \ \ \ \ \_\_HAL\_RCC\_TIM14\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00718}00718\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00719}00719\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00720}00720\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00721}00721\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00722}00722\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
|
||||
\end{DoxyCode}
|
||||
144
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h.tex
Normal file
144
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h.tex
Normal file
@@ -0,0 +1,144 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/general\+\_\+tim.h File Reference}
|
||||
\hypertarget{general__tim_8h}{}\label{general__tim_8h}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_tim.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_tim.h}}
|
||||
|
||||
|
||||
Заголовочный файл для модуля инициализации таймеров и работы с ними.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}mylibs\+\_\+defs.\+h"{}}\newline
|
||||
{\ttfamily \#include "{}general\+\_\+gpio.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+tim.\+h\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=214pt]{general__tim_8h__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
This graph shows which files directly or indirectly include this file\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__tim_8h__dep__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура инициализации таймера \end{DoxyCompactList}\item
|
||||
struct \mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура инициализации енкодера \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Macros}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga23382b8f04b3e6db2c59dfa1ef5ea4a2}{HAL\+\_\+\+TIM\+\_\+\+MODULE\+\_\+\+ENABLED}}
|
||||
\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga54a98c21365e0bc45b81555d2b101f2b}{USE\+\_\+\+TIM1}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM1 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga72535a44955b43cbcd56e25039ab32eb}{USE\+\_\+\+TIM2}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM2 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga5b5685a43273b6e37242a4aba3ee0617}{USE\+\_\+\+TIM3}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM3 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga1493b39c9214501180b81b4c892f9be0}{USE\+\_\+\+TIM4}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM4 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga252f4fba93fc265110e83760e0590af3}{USE\+\_\+\+TIM5}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM5 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga8fe31b98160627d19038222910be3f46}{USE\+\_\+\+TIM6}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM6 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga7cdc54cc8cbbb6e9f60001f1e3e6ec67}{USE\+\_\+\+TIM7}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM7 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga28ba33d7c6bf22821dafa5bcee4854be}{USE\+\_\+\+TIM8}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM8 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_gaac627c0e98c9594cc41b1b46eb39e44a}{USE\+\_\+\+TIM9}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM9 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga98c0691052d1da2c4053dd3586ff7ce9}{USE\+\_\+\+TIM10}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM10 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga176c97f06ebcf14e06e5c5bdbfac44c2}{USE\+\_\+\+TIM11}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM11 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga4e2b0e6cdf9eed74581b575c3fd9516b}{USE\+\_\+\+TIM12}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM12 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_gaf48ef87650517652ddec039a189507ac}{USE\+\_\+\+TIM13}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM13 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___t_i_m___i_n_i_t_ga9ae40be31d5271abe3e49f896d916d5c}{USE\+\_\+\+TIM14}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить TIM14 в \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{general__tim_8h_a867308f75c1be4f2090bcda3bcd900c9}{TIM\+\_\+\+IT\+\_\+\+CONF\+\_\+\+Pos}}~0
|
||||
\item
|
||||
\#define \mbox{\hyperlink{general__tim_8h_a8c43257cbfd6ac70b6eb0839e47bbd07}{TIM\+\_\+\+IT\+\_\+\+CONF}}~(1$<$$<$(TIM\+\_\+\+IT\+\_\+\+CONF\+\_\+\+Pos))
|
||||
\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Enumerations}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}} \{ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8}{TIM\+\_\+\+DEFAULT}} = 0
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}{TIM\+\_\+\+IT\+\_\+\+MODE}} = TIM\+\_\+\+IT\+\_\+\+CONF
|
||||
\}
|
||||
\begin{DoxyCompactList}\small\item\em Режим прерываний таймера \end{DoxyCompactList}\item
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{TIM\+\_\+\+MHz\+Tick\+Base\+Type\+Def}} \{ \newline
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5}{TIM\+\_\+\+Base\+\_\+\+Disable}} = 0
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2}{TIM\+\_\+\+Tick\+Base\+\_\+1\+US}} = 1
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}{TIM\+\_\+\+Tick\+Base\+\_\+10\+US}} = 10
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30}{TIM\+\_\+\+Tick\+Base\+\_\+100\+US}} = 100
|
||||
, \newline
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25}{TIM\+\_\+\+Tick\+Base\+\_\+1\+MS}} = 1000
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa}{TIM\+\_\+\+Tick\+Base\+\_\+10\+MS}} = 10000
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da}{TIM\+\_\+\+Tick\+Base\+\_\+100\+MS}} = 100000
|
||||
\}
|
||||
\begin{DoxyCompactList}\small\item\em Длительность тика таймера (частота тактирования таймера) \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}stim)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация таймера. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}} it\+\_\+mode)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация CLK и NVIC таймеров. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{TIM\+\_\+\+Base\+\_\+\+Msp\+De\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация CLK и NVIC таймеров. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\+\_\+\+Delay\+\_\+\+Start}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Начать отсчет неблокирующей задержки. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\+\_\+\+Delay}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint16\+\_\+t delay)
|
||||
\begin{DoxyCompactList}\small\item\em Задержка в тиках таймера (блокирующая). \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\+\_\+\+Delay\+\_\+\+Non\+Blocking}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint16\+\_\+t delay)
|
||||
\begin{DoxyCompactList}\small\item\em Задержка в тиках таймера (неблокирующая). \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\+\_\+\+Output\+\_\+\+PWM\+\_\+\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, TIM\+\_\+\+OC\+\_\+\+Init\+Type\+Def \texorpdfstring{$\ast$}{*}s\+Config\+OC, uint32\+\_\+t TIM\+\_\+\+CHANNEL, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t PWM\+\_\+\+PIN)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация выхода ШИМ таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\+\_\+\+OC\+\_\+\+Comparator\+\_\+\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint32\+\_\+t TIM\+\_\+\+CHANNEL)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация OC компаратора таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\+\_\+\+Encoder\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc1, TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация режима энкодер у таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\+\_\+\+Encoder\+\_\+\+Read}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
|
||||
\begin{DoxyCompactList}\small\item\em Считать энкодер. \end{DoxyCompactList}\item
|
||||
int \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\+\_\+\+Encoder\+\_\+\+Read\+Switch}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
|
||||
\begin{DoxyCompactList}\small\item\em Считать кнопку энкодера. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Заголовочный файл для модуля инициализации таймеров и работы с ними.
|
||||
|
||||
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__tim_8h_source}{general\+\_\+tim.\+h}}.
|
||||
|
||||
|
||||
|
||||
\label{doc-define-members}
|
||||
\Hypertarget{general__tim_8h_doc-define-members}
|
||||
\doxysubsection{Macro Definition Documentation}
|
||||
\Hypertarget{general__tim_8h_a867308f75c1be4f2090bcda3bcd900c9}\index{general\_tim.h@{general\_tim.h}!TIM\_IT\_CONF\_Pos@{TIM\_IT\_CONF\_Pos}}
|
||||
\index{TIM\_IT\_CONF\_Pos@{TIM\_IT\_CONF\_Pos}!general\_tim.h@{general\_tim.h}}
|
||||
\doxysubsubsection{\texorpdfstring{TIM\_IT\_CONF\_Pos}{TIM\_IT\_CONF\_Pos}}
|
||||
{\footnotesize\ttfamily \label{general__tim_8h_a867308f75c1be4f2090bcda3bcd900c9}
|
||||
\#define TIM\+\_\+\+IT\+\_\+\+CONF\+\_\+\+Pos~0}
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8h_source_l00058}{58}} of file \mbox{\hyperlink{general__tim_8h_source}{general\+\_\+tim.\+h}}.
|
||||
|
||||
\Hypertarget{general__tim_8h_a8c43257cbfd6ac70b6eb0839e47bbd07}\index{general\_tim.h@{general\_tim.h}!TIM\_IT\_CONF@{TIM\_IT\_CONF}}
|
||||
\index{TIM\_IT\_CONF@{TIM\_IT\_CONF}!general\_tim.h@{general\_tim.h}}
|
||||
\doxysubsubsection{\texorpdfstring{TIM\_IT\_CONF}{TIM\_IT\_CONF}}
|
||||
{\footnotesize\ttfamily \label{general__tim_8h_a8c43257cbfd6ac70b6eb0839e47bbd07}
|
||||
\#define TIM\+\_\+\+IT\+\_\+\+CONF~(1$<$$<$(TIM\+\_\+\+IT\+\_\+\+CONF\+\_\+\+Pos))}
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8h_source_l00065}{65}} of file \mbox{\hyperlink{general__tim_8h_source}{general\+\_\+tim.\+h}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
14f61c9b62fbfc946bfe7c42f49acae2
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h__dep__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h__dep__incl.pdf
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
e71808e8c11f07d6097219cb8d26f349
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h__incl.pdf
Normal file
Binary file not shown.
308
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h_source.tex
Normal file
308
AllLibs/PeriphGeneral/Doc/latex/general__tim_8h_source.tex
Normal file
@@ -0,0 +1,308 @@
|
||||
\doxysection{general\+\_\+tim.\+h}
|
||||
\hypertarget{general__tim_8h_source}{}\label{general__tim_8h_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_tim.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_tim.h}}
|
||||
\mbox{\hyperlink{general__tim_8h}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_tim.h}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Заголовочный\ файл\ для\ модуля\ инициализации\ таймеров\ и\ работы\ с\ ними.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00006}00006\ \textcolor{comment}{*\ @defgroup\ GENERAL\_TIM\ \ \ \ \ \ TIM\ Tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ STM32\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00008}00008\ \textcolor{comment}{*\ @brief\ \ \ \ Функции\ и\ макросы\ для\ удобной\ работы\ с\ TIM.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00009}00009\ \textcolor{comment}{*\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00010}00010\ \textcolor{comment}{Модуль\ предоставляет\ универсальные\ инструменты\ для\ работы\ с\ TIM:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00011}00011\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_TIM\_GENERAL\ \ —\ базовая\ инициализация\ таймеров\ и\ прерываний.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00012}00012\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_TIM\_DELAY\ \ \ \ —\ функции\ задержки\ через\ таймеры\ (blocking\ и\ non-\/blocking).}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00013}00013\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_TIM\_OC\ \ \ \ \ \ \ —\ настройка\ каналов\ Output\ Compare\ и\ PWM.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00014}00014\ \textcolor{comment}{\ \ -\/\ @ref\ \ MYLIBS\_TIM\_ENCODER\ \ —\ работа\ с\ энкодерами,\ чтение\ положения\ и\ кнопки.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00015}00015\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00016}00016\ \textcolor{comment}{*\ \ @note\ Требуется\ подключение\ модуля\ TIM\ в\ библиотеке\ HAL\ и\ GPIO\ (@ref\ GENERAL\_GPIO)\ из\ MyLibs}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00017}00017\ \textcolor{comment}{@code\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00018}00018\ \textcolor{comment}{\#define\ HAL\_TIM\_MODULE\_ENABLED}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00019}00019\ \textcolor{comment}{@endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00020}00020\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00021}00021\ \textcolor{preprocessor}{\#ifndef\ \_\_TIM\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00022}00022\ \textcolor{preprocessor}{\#define\ \_\_TIM\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00023}00023\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00024}00024\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00025}00025\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00026}00026\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00027}00027\ \textcolor{comment}{\ \ *\ @addtogroup\ TIM\_INIT\ TIM\ Init\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00028}00028\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MYLIBS\_TIM\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00029}00029\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_CONFIGS\ Конфигурации\ STM32\ General}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00030}00030\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Настройка\ таймеров}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00031}00031\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00032}00032\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00033}00033\ \textcolor{preprocessor}{\#define\ HAL\_TIM\_MODULE\_ENABLED}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00034}00034\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00035}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga54a98c21365e0bc45b81555d2b101f2b}{00035}}\ \textcolor{preprocessor}{\#define\ USE\_TIM1\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM1\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00036}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga72535a44955b43cbcd56e25039ab32eb}{00036}}\ \textcolor{preprocessor}{\#define\ USE\_TIM2\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM2\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00037}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga5b5685a43273b6e37242a4aba3ee0617}{00037}}\ \textcolor{preprocessor}{\#define\ USE\_TIM3\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM3\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00038}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga1493b39c9214501180b81b4c892f9be0}{00038}}\ \textcolor{preprocessor}{\#define\ USE\_TIM4\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM4\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00039}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga252f4fba93fc265110e83760e0590af3}{00039}}\ \textcolor{preprocessor}{\#define\ USE\_TIM5\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM5\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00040}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga8fe31b98160627d19038222910be3f46}{00040}}\ \textcolor{preprocessor}{\#define\ USE\_TIM6\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM6\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00041}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga7cdc54cc8cbbb6e9f60001f1e3e6ec67}{00041}}\ \textcolor{preprocessor}{\#define\ USE\_TIM7\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM7\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00042}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga28ba33d7c6bf22821dafa5bcee4854be}{00042}}\ \textcolor{preprocessor}{\#define\ USE\_TIM8\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM8\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00043}\mbox{\hyperlink{group___t_i_m___i_n_i_t_gaac627c0e98c9594cc41b1b46eb39e44a}{00043}}\ \textcolor{preprocessor}{\#define\ USE\_TIM9\ \ \ \ }\textcolor{comment}{///<\ Включить\ TIM9\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00044}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga98c0691052d1da2c4053dd3586ff7ce9}{00044}}\ \textcolor{preprocessor}{\#define\ USE\_TIM10\ \ \ }\textcolor{comment}{///<\ Включить\ TIM10\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00045}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga176c97f06ebcf14e06e5c5bdbfac44c2}{00045}}\ \textcolor{preprocessor}{\#define\ USE\_TIM11\ \ \ }\textcolor{comment}{///<\ Включить\ TIM11\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00046}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga4e2b0e6cdf9eed74581b575c3fd9516b}{00046}}\ \textcolor{preprocessor}{\#define\ USE\_TIM12\ \ \ }\textcolor{comment}{///<\ Включить\ TIM12\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00047}\mbox{\hyperlink{group___t_i_m___i_n_i_t_gaf48ef87650517652ddec039a189507ac}{00047}}\ \textcolor{preprocessor}{\#define\ USE\_TIM13\ \ \ }\textcolor{comment}{///<\ Включить\ TIM13\ в\ @ref\ TIM\_Base\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00048}\mbox{\hyperlink{group___t_i_m___i_n_i_t_ga9ae40be31d5271abe3e49f896d916d5c}{00048}}\ \textcolor{preprocessor}{\#define\ USE\_TIM14\ \ \ }\textcolor{comment}{///<\ Включить\ TIM14\ в\ @ref\ TIM\_Base\_MspInit}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00049}00049\ \textcolor{comment}{/**\ TIM\_INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00050}00050\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00051}00051\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00052}00052\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00053}00053\ \textcolor{preprocessor}{\#include\ "{}mylibs\_defs.h"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00054}00054\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__gpio_8h}{general\_gpio.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00055}00055\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00056}00056\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00057}00057\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00058}00058\ \textcolor{preprocessor}{\#define\ TIM\_IT\_CONF\_Pos\ \ \ \ \ \ \ \ \ \ \ 0}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00059}00059\ \textcolor{comment}{//\#define\ TIM\_PWM\_CONF\_Pos\ \ \ \ \ \ \ \ \ \ 1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00060}00060\ \textcolor{comment}{//\#define\ TIM\_CLCK\_SRC\_CONF\_Pos\ \ \ \ \ 2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00061}00061\ \textcolor{comment}{//\#define\ TIM\_SLAVE\_CONF\_Pos\ \ \ \ \ \ \ \ 3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00062}00062\ \textcolor{comment}{//\#define\ TIM\_MASTER\_CONF\_Pos\ \ \ \ \ \ \ 4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00063}00063\ \textcolor{comment}{//\#define\ TIM\_BDTR\_CONF\_Pos\ \ \ \ \ \ \ \ \ 5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00064}00064\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00065}00065\ \textcolor{preprocessor}{\#define\ TIM\_IT\_CONF\ \ \ (1<<(TIM\_IT\_CONF\_Pos))}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00066}00066\ \textcolor{comment}{//\#define\ TIM\_PWM\_CONF\ \ \ \ \ \ (1<<(TIM\_PWM\_Pos))}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00067}00067\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00068}00068\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////]}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00069}00069\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00070}00070\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00071}00071\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00072}00072\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00073}00073\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00074}00074\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00075}00075\ \textcolor{comment}{\ \ *\ @brief\ Режим\ прерываний\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00076}00076\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_TIM\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00077}00077\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00078}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{00078}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00079}00079\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00080}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8}{00080}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8}{TIM\_DEFAULT}}\ =\ \ \ \ \ \ \ \ \ 0,\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Прерываний\ отключены}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00081}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}{00081}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}{TIM\_IT\_MODE}}\ =\ \ \ \ \ \ \ \ \ TIM\_IT\_CONF,\ \ \textcolor{comment}{///<\ Прерываний\ включены}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00082}00082\ \textcolor{comment}{//\ \ TIM\_PWM\_MODE\ =\ \ \ \ \ \ \ \ TIM\_PWM\_ENABLE,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00083}00083\ \textcolor{comment}{//\ \ TIM\_PWM\_IT\_MODE\ =\ \ \ \ \ TIM\_PWM\_ENABLE\ |\ TIM\_IT\_CONF,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00084}00084\ \}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\_ITModeTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00085}00085\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00086}00086\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00087}00087\ \textcolor{comment}{\ \ *\ @brief\ Длительность\ тика\ таймера\ (частота\ тактирования\ таймера)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00088}00088\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_TIM\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00089}00089\ \textcolor{comment}{\ \ *\ @details\ \ enum\ дает\ базовые\ длительности,\ но\ можно\ выставить\ другие}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00090}00090\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ (напр\ 500\ -\/\ 0.5\ мс)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00091}00091\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00092}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{00092}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00093}00093\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00094}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5}{00094}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5}{TIM\_Base\_Disable}}\ =\ \ \ \ \ \ 0,\ \ \ \ \ \ \textcolor{comment}{///<\ Таймер\ отключен}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00095}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2}{00095}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2}{TIM\_TickBase\_1US}}\ =\ \ \ \ \ \ 1,\ \ \ \ \ \ \textcolor{comment}{///<\ Таймер\ тактируется\ с\ частотой\ 1\ \ \ \ МГц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00096}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}{00096}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}{TIM\_TickBase\_10US}}\ =\ \ \ \ \ 10,\ \ \ \ \ \textcolor{comment}{///<\ Таймер\ тактируется\ с\ частотой\ 100\ \ кГц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00097}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30}{00097}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30}{TIM\_TickBase\_100US}}\ =\ \ \ \ 100,\ \ \ \ \textcolor{comment}{///<\ Таймер\ тактируется\ с\ частотой\ 10\ \ \ кГц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00098}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25}{00098}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25}{TIM\_TickBase\_1MS}}\ =\ \ \ \ \ \ 1000,\ \ \ \textcolor{comment}{///<\ Таймер\ тактируется\ с\ частотой\ 1\ \ \ \ кГц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00099}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa}{00099}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa}{TIM\_TickBase\_10MS}}\ =\ \ \ \ \ 10000,\ \ \textcolor{comment}{///<\ Таймер\ тактируется\ с\ частотой\ 100\ \ Гц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00100}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da}{00100}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da}{TIM\_TickBase\_100MS}}\ =\ \ \ \ 100000,\ \textcolor{comment}{///<\ Таймер\ тактируется\ с\ частотой\ 10\ \ \ Гц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00101}00101\ \}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{TIM\_MHzTickBaseTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00102}00102\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00103}00103\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00104}00104\ \textcolor{comment}{\ \ *\ @brief\ Структура\ инициализации\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00105}00105\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_TIM\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00106}00106\ \textcolor{comment}{\ \ *\ @details\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00107}00107\ \textcolor{comment}{\ \ *\ Содержит\ все\ базовые\ структуры,\ которые\ нужны\ для\ инициализации\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00108}00108\ \textcolor{comment}{\ \ *\ Если\ структуры\ настроек\ не\ заданы,\ то\ они\ заполнятся\ сами\ дефолтными\ параметрами\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00109}00109\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00110}00110\ \textcolor{comment}{\ \ *\ Также\ высокоуровневые\ настройки\ частоты\ работы\ таймера.\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00111}00111\ \textcolor{comment}{\ \ *\ Если\ какая-\/либо\ высокоуровневая\ настройка\ не\ задана,\ то\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00112}00112\ \textcolor{comment}{\ \ *\ по\ возможности\ берется\ низкоуровневая\ настройка\ из\ структур}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00113}00113\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00114}\mbox{\hyperlink{struct_t_i_m___settings_type_def}{00114}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\textcolor{comment}{//\ struct\ with\ settings\ for\ custom\ function}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00115}00115\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00116}\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{00116}}\ \ \ TIM\_HandleTypeDef\ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ HAL\ handle\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00117}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{00117}}\ \ \ TIM\_ClockConfigTypeDef\ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}};\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Настройки\ тактирования\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00118}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a9694cf0910a69d48ff94f8aeac106969}{00118}}\ \ \ TIM\_SlaveConfigTypeDef\ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a9694cf0910a69d48ff94f8aeac106969}{sSlaveConfig}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Настройки\ слейв\ режима\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00119}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a2d9d277dd395424b964445ec1bc65b21}{00119}}\ \ \ TIM\_MasterConfigTypeDef\ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a2d9d277dd395424b964445ec1bc65b21}{sMasterConfig}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Настройки\ мастер\ режима\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00120}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a961f19f0e1672715c27bc94d7871dbb7}{00120}}\ \ \ TIM\_BreakDeadTimeConfigTypeDef\ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a961f19f0e1672715c27bc94d7871dbb7}{sBreakDeadTimeConfig}};\ \ \textcolor{comment}{///<\ Настройки\ дедтаймов\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00121}00121\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00122}\mbox{\hyperlink{struct_t_i_m___settings_type_def_ab90e370c3edda88e76583293c250d2b0}{00122}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\_ITModeTypeDef}}\ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_ab90e370c3edda88e76583293c250d2b0}{sTimMode}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Настройки\ прерывания\ таймера\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00123}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{00123}}\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{TIM\_MHzTickBaseTypeDef}}\ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Длительность\ одного\ тика\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00124}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{00124}}\ \ \ uint8\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}};\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Дополнительный\ делитель,\ для\ удобного\ деления\ @ref\ sTickBaseUS}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00125}\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{00125}}\ \ \ \textcolor{keywordtype}{float}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Частота\ шины\ тактирования\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00126}\mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{00126}}\ \ \ \textcolor{keywordtype}{float}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{sTimFreqHz}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Желаемая\ частота\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00127}00127\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00128}00128\ \}\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00129}00129\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00130}00130\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00131}00131\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00132}00132\ \textcolor{comment}{\ \ *\ @brief\ Структура\ инициализации\ енкодера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00133}00133\ \textcolor{comment}{\ \ *\ @ingroup\ \ MYLIBS\_TIM\_ENCODER}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00134}00134\ \textcolor{comment}{\ \ *\ @details\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00135}00135\ \textcolor{comment}{\ \ *\ Содержит\ все\ базовые\ структуры,\ которые\ нужны\ для\ инициализации\ таймера.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00136}00136\ \textcolor{comment}{\ \ *\ Если\ структуры\ настроек\ не\ заданы,\ то\ они\ заполнятся\ сами\ дефолтными\ параметрами\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00137}00137\ \textcolor{comment}{\ \ *\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00138}00138\ \textcolor{comment}{\ \ *\ Также\ высокоуровневые\ настройки\ частоты\ работы\ таймера.\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00139}00139\ \textcolor{comment}{\ \ *\ Если\ какая-\/либо\ высокоуровневая\ настройка\ не\ задана,\ то\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00140}00140\ \textcolor{comment}{\ \ *\ по\ возможности\ берется\ низкоуровневая\ настройка\ из\ структур}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00141}00141\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00142}\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{00142}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\textcolor{comment}{//\ struct\ with\ variables\ for\ encoder}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00143}00143\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00144}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6f769f027b760a4b496e2b2b77bf54a3}{00144}}\ \ \ int16\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6f769f027b760a4b496e2b2b77bf54a3}{Encoder\_Diff}};\ \ \ \textcolor{comment}{///<\ Считанная\ разница}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00145}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a0dacce3dde7df3122583869d96a372a2}{00145}}\ \ \ uint16\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a0dacce3dde7df3122583869d96a372a2}{Encoder\_Shdw}};\ \ \ \textcolor{comment}{///<\ Последние\ считанные\ тики}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00146}00146\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00147}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{00147}}\ \ \ TIM\_HandleTypeDef\ \ \ \ \ \ \ *\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}};\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Указатель\ на\ HAL\ handle\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00148}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a021f0c585e9e62d68a4b09f630d8b6e5}{00148}}\ \ \ TIM\_Encoder\_InitTypeDef\ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a021f0c585e9e62d68a4b09f630d8b6e5}{sConfig}};\ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Указатель\ на\ структуру\ настройки\ энкодера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00149}00149\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00150}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{00150}}\ \ \ GPIO\_TypeDef\ \ \ \ \ \ \ \ \ \ \ \ *\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}};\ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт,\ куда\ подключается\ энкодер}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00151}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{00151}}\ \ \ uint32\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}};\ \ \ \textcolor{comment}{///<\ Пин,\ куда\ подключается\ канал\ TI1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00152}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{00152}}\ \ \ uint32\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}};\ \ \ \textcolor{comment}{///<\ Пин,\ куда\ подключается\ канал\ TI2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00153}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{00153}}\ \ \ uint32\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}};\ \ \ \ \textcolor{comment}{///<\ Пин,\ куда\ кнопка\ энкодера\ (если\ есть)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00154}00154\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00155}\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a99295760ff8b27d1e6f1710f29383a45}{00155}}\ \ \ \mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}}\ \ \ \ \ \ \mbox{\hyperlink{struct_t_i_m___encoder_type_def_a99295760ff8b27d1e6f1710f29383a45}{Sw}};\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Структура\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00156}00156\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00157}00157\ \}\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}};\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00158}00158\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00159}00159\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00160}00160\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00161}00161\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00162}00162\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00163}00163\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_TIM\_GENERAL\ \ General\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00164}00164\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_TIM}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00165}00165\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Функции\ для\ базовой\ инициализации\ таймеров}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00166}00166\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00167}00167\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00168}00168\ \textcolor{comment}{\ \ \ \ TIM\_SettingsTypeDef\ tim2Settings;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00169}00169\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00170}00170\ \textcolor{comment}{\ \ \ \ void\ TIM2\_Init(void)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00171}00171\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00172}00172\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Настройка\ таймера\ TIM2\ на\ 1\ кГц\ с\ прерываниями\ с\ шагом\ таймера\ 10\ мкс}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00173}00173\ \textcolor{comment}{\ \ \ \ \ \ \ \ tim2Settings.htim.Instance\ =\ TIM2;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00174}00174\ \textcolor{comment}{\ \ \ \ \ \ \ \ tim2Settings.sTimMode\ =\ TIM\_IT\_MODE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00175}00175\ \textcolor{comment}{\ \ \ \ \ \ \ \ tim2Settings.sTickBaseUS\ =\ TIM\_TickBase\_10US;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00176}00176\ \textcolor{comment}{\ \ \ \ \ \ \ \ tim2Settings.sTickBasePrescaler\ =\ 1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00177}00177\ \textcolor{comment}{\ \ \ \ \ \ \ \ tim2Settings.sTimFreqHz\ =\ 1000;\ //\ 1\ кГц}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00178}00178\ \textcolor{comment}{\ \ \ \ \ \ \ \ tim2Settings.sTimAHBFreqMHz\ =\ 72000000;\ //\ Hz}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00179}00179\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00180}00180\ \textcolor{comment}{\ \ \ \ \ \ \ \ if(TIM\_Base\_Init(\&tim2Settings)\ !=\ HAL\_OK)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00181}00181\ \textcolor{comment}{\ \ \ \ \ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00182}00182\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ Error\_Handler();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00183}00183\ \textcolor{comment}{\ \ \ \ \ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00184}00184\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00185}00185\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00186}00186\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00187}00187\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00188}00188\ \textcolor{comment}{/*\ Initialize\ TIM\ with\ TIM\_SettingsTypeDef\ structure\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00189}00189\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\_Base\_Init}}(\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}}*\ stim);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00190}00190\ \textcolor{comment}{/*\ Initialize\ TIMs\ clock\ and\ interrupt\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00191}00191\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\_Base\_MspInit}}(TIM\_HandleTypeDef*\ htim,\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\_ITModeTypeDef}}\ it\_mode);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00192}00192\ \textcolor{comment}{/*\ DeInitialize\ TIMs\ clock\ and\ interrupt\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00193}00193\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{TIM\_Base\_MspDeInit}}(TIM\_HandleTypeDef*\ htim);\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00194}00194\ \textcolor{comment}{/**\ MYLIBS\_TIM\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00195}00195\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00196}00196\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00197}00197\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00198}00198\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00199}00199\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_TIM\_DELAY\ \ Delay\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00200}00200\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_TIM}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00201}00201\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Функции\ для\ формирования\ задержек\ с\ помощью\ таймеров}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00202}00202\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00203}00203\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00204}00204\ \textcolor{comment}{\ \ \ \ TIM\_HandleTypeDef\ htim2;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00205}00205\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00206}00206\ \textcolor{comment}{\ \ \ \ //\ блокирующая\ задержка\ 500\ тиков\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00207}00207\ \textcolor{comment}{\ \ \ \ LED\_ON();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00208}00208\ \textcolor{comment}{\ \ \ \ TIM\_Delay(\&htim2,\ 500);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00209}00209\ \textcolor{comment}{\ \ \ \ LED\_OFF();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00210}00210\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00211}00211\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00212}00212\ \textcolor{comment}{\ \ \ \ while(1)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00213}00213\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00214}00214\ \textcolor{comment}{\ \ \ \ \ \ //\ не\ блокирующая\ задержка\ 200\ тиков\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00215}00215\ \textcolor{comment}{\ \ \ \ \ \ if(TIM\_Delay\_NonBlocking(\&htim2,\ 200)\ ==\ HAL\_OK)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00216}00216\ \textcolor{comment}{\ \ \ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00217}00217\ \textcolor{comment}{\ \ \ \ \ \ \ \ TIM\_Delay\_Start(\&htim2);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00218}00218\ \textcolor{comment}{\ \ \ \ \ \ \ \ LED\_TOOGLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00219}00219\ \textcolor{comment}{\ \ \ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00220}00220\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00221}00221\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00222}00222\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00223}00223\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00224}00224\ \textcolor{comment}{/*\ Start\ delay\ via\ TIM\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00225}00225\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\_Delay\_Start}}(TIM\_HandleTypeDef\ *htim);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00226}00226\ \textcolor{comment}{/*\ Delay\ via\ TIM\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00227}00227\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\_Delay}}(TIM\_HandleTypeDef\ *htim,\ uint16\_t\ delay);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00228}00228\ \textcolor{comment}{/*\ Wait\ Delay\ via\ TIM\ without\ blocking\ app\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00229}00229\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\_Delay\_NonBlocking}}(TIM\_HandleTypeDef\ *htim,\ uint16\_t\ delay);\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00230}00230\ \textcolor{comment}{/**\ MYLIBS\_TIM\_DELAY}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00231}00231\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00232}00232\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00233}00233\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00234}00234\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00235}00235\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_TIM\_OC\ PWM/OC\ Channels\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00236}00236\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_TIM}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00237}00237\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Функции\ для\ инициализации\ базовых\ функций\ каналов\ таймера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00238}00238\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00239}00239\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00240}00240\ \textcolor{comment}{\ \ \ \ void\ PWM\_Channel\_Init\_Example(void)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00241}00241\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00242}00242\ \textcolor{comment}{\ \ \ \ \ \ \ \ TIM\_HandleTypeDef\ htim3;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00243}00243\ \textcolor{comment}{\ \ \ \ \ \ \ \ TIM\_OC\_InitTypeDef\ sConfigOC;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00244}00244\ \textcolor{comment}{\ \ \ \ \ \ \ \ GPIO\_TypeDef\ *GPIOx\ =\ GPIOB;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00245}00245\ \textcolor{comment}{\ \ \ \ \ \ \ \ uint32\_t\ PWM\_PIN\ =\ GPIO\_PIN\_0;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00246}00246\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00247}00247\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Настройка\ таймера\ и\ канала\ PWM}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00248}00248\ \textcolor{comment}{\ \ \ \ \ \ \ \ TIM\_Output\_PWM\_Init(\&htim3,\ \&sConfigOC,\ TIM\_CHANNEL\_1,\ GPIOx,\ PWM\_PIN);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00249}00249\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00250}00250\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Настройка\ компаратора\ OC}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00251}00251\ \textcolor{comment}{\ \ \ \ \ \ \ \ TIM\_OC\_Comparator\_Init(\&htim3,\ TIM\_CHANNEL\_1);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00252}00252\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00253}00253\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00254}00254\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00255}00255\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00256}00256\ \textcolor{comment}{/*\ Initialize\ PWM\ Channel\ and\ GPIO\ for\ output\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00257}00257\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\_Output\_PWM\_Init}}(TIM\_HandleTypeDef\ *htim,\ TIM\_OC\_InitTypeDef\ *sConfigOC,\ uint32\_t\ TIM\_CHANNEL,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ PWM\_PIN);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00258}00258\ \textcolor{comment}{/*\ Initialize\ OC\ Comparator\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00259}00259\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\_OC\_Comparator\_Init}}(TIM\_HandleTypeDef\ *htim,\ uint32\_t\ TIM\_CHANNEL);\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00260}00260\ \textcolor{comment}{/**\ MYLIBS\_TIM\_ENCODER}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00261}00261\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00262}00262\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00263}00263\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00264}00264\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00265}00265\ \textcolor{comment}{\ \ *\ @addtogroup\ MYLIBS\_TIM\_ENCODER\ Encoder\ tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00266}00266\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_TIM}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00267}00267\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Функции\ для\ считывания\ энкодера}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00268}00268\ \textcolor{comment}{\ \ *\ @par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00269}00269\ \textcolor{comment}{\ \ \ \ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00270}00270\ \textcolor{comment}{\ \ \ \ TIM\_EncoderTypeDef\ henc1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00271}00271\ \textcolor{comment}{\ \ \ \ TIM\_HandleTypeDef\ htim4;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00272}00272\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00273}00273\ \textcolor{comment}{\ \ \ \ //\ инициализация}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00274}00274\ \textcolor{comment}{\ \ \ \ henc1.htim\ =\ \&htim4;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00275}00275\ \textcolor{comment}{\ \ \ \ henc1.GPIOx\ =\ GPIOA;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00276}00276\ \textcolor{comment}{\ \ \ \ henc1.GPIO\_PIN\_TI1\ =\ GPIO\_PIN\_0;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00277}00277\ \textcolor{comment}{\ \ \ \ henc1.GPIO\_PIN\_TI2\ =\ GPIO\_PIN\_1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00278}00278\ \textcolor{comment}{\ \ \ \ TIM\_Encoder\_Init(\&henc1,\ \&htim4);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00279}00279\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00280}00280\ \textcolor{comment}{\ \ \ \ //\ считывание\ энкодера\ и\ кнопки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00281}00281\ \textcolor{comment}{\ \ \ \ int16\_t\ delta\ =\ TIM\_Encoder\_Read(\&henc1);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00282}00282\ \textcolor{comment}{\ \ \ \ setpoint\_tmp\ +=\ delta;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00283}00283\ \textcolor{comment}{\ \ \ \ if(TIM\_Encoder\_ReadSwitch(\&henc1))}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00284}00284\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00285}00285\ \textcolor{comment}{\ \ \ \ \ \ setpoint\ =\ setpoint\_tmp;\ //\ подтвердить\ новое\ значение}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00286}00286\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00287}00287\ \textcolor{comment}{\ \ \ \ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00288}00288\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00289}00289\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00290}00290\ \textcolor{comment}{/*\ Initialize\ TIM\ Encoder\ functional\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00291}00291\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\_Encoder\_Init}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc1,\ TIM\_HandleTypeDef\ *htim);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00292}00292\ \textcolor{comment}{/*\ Считать\ энкодер\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00293}00293\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\_Encoder\_Read}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc);}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00294}00294\ \textcolor{comment}{/*\ Считать\ кнопку\ энкодера\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00295}00295\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\_Encoder\_ReadSwitch}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc);\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00296}00296\ \textcolor{comment}{/**\ MYLIBS\_TIM\_ENCODER}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00297}00297\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00298}00298\ \textcolor{comment}{\ \ */}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00299}00299\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00300}00300\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00301}00301\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__tim_8h_source_l00302}00302\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_TIM\_GENERAL\_H\_}}
|
||||
|
||||
\end{DoxyCode}
|
||||
99
AllLibs/PeriphGeneral/Doc/latex/general__uart_8c.tex
Normal file
99
AllLibs/PeriphGeneral/Doc/latex/general__uart_8c.tex
Normal file
@@ -0,0 +1,99 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Src/general\+\_\+uart.c File Reference}
|
||||
\hypertarget{general__uart_8c}{}\label{general__uart_8c}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_uart.c@{E:/.WORK/STM32/STM\_Libs/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___g_e_n_e_r_a_l___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___g_e_n_e_r_a_l___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___g_e_n_e_r_a_l___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___g_e_n_e_r_a_l___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}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
73551e2f9e2a1b4e70f1fc75e08e7ede
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__uart_8c__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__uart_8c__incl.pdf
Normal file
Binary file not shown.
389
AllLibs/PeriphGeneral/Doc/latex/general__uart_8c_source.tex
Normal file
389
AllLibs/PeriphGeneral/Doc/latex/general__uart_8c_source.tex
Normal file
@@ -0,0 +1,389 @@
|
||||
\doxysection{general\+\_\+uart.\+c}
|
||||
\hypertarget{general__uart_8c_source}{}\label{general__uart_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_uart.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_uart.c}}
|
||||
\mbox{\hyperlink{general__uart_8c}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_uart.c}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Модуль\ для\ инициализации\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00006}00006\ \textcolor{comment}{Реализация\ функций\ для\ работы\ с\ UART:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00007}00007\ \textcolor{comment}{\ \ -\/\ Инициализация\ UART\ и\ его\ линий\ RX/TX}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00008}00008\ \textcolor{comment}{\ \ -\/\ Настройка\ DMA\ для\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00009}00009\ \textcolor{comment}{\ \ -\/\ Настройка\ GPIO\ для\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00010}00010\ \textcolor{comment}{\ \ -\/\ Настройка\ NVIC\ и\ тактирования\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00011}00011\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00012}00012\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__uart_8h}{general\_uart.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00013}00013\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__gpio_8h}{general\_gpio.h}}"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00014}00014\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00015}00015\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00016}00016\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/UART\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00017}00017\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00018}00018\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ UART\ с\ помощью\ структуры\ UART\_SettingsTypeDef.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00019}00019\ \textcolor{comment}{\ \ *\ @param\ \ suart\ Указатель\ на\ структуру\ с\ настройками\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00020}00020\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00021}00021\ \textcolor{comment}{\ \ *\ @details\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00022}00022\ \textcolor{comment}{\ \ *\ Инициализирует\ UART\ и\ его\ GPIO\ и\ при\ необходимости\ DMA.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00023}00023\ \textcolor{comment}{\ \ *\ Настройка\ аналогична\ HAL\_UART\_Init\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00024}00024\ \textcolor{comment}{\ \ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00025}00025\ \textcolor{comment}{\ \ *\ suart.huart.Init...}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00026}00026\ \textcolor{comment}{\ \ *\ @endcode\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00027}00027\ \textcolor{comment}{\ \ *\ но\ дополнительно\ надо\ прописать\ пины\ RX/TX\ @ref\ UART\_SettingsTypeDef}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00028}00028\ \textcolor{comment}{\ \ *\ @code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00029}00029\ \textcolor{comment}{\ \ *\ suart-\/>GPIOx,\ suart-\/>GPIO\_PIN\_RX,\ suart-\/>GPIO\_PIN\_TX}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00030}00030\ \textcolor{comment}{\ \ *\ @endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00031}00031\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00032}\mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9f07396b778505c934143e89953e154}{00032}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9f07396b778505c934143e89953e154}{UART\_Base\_Init}}(\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00033}00033\ \{\ \textcolor{comment}{//\ function\ takes\ setting\ structure\ for\ init}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00034}00034\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00035}00035\ \ \ \textcolor{comment}{//\ check\ is\ settings\ are\ valid}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00036}00036\ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}{UART\_Check\_Init\_Struct}}(suart)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00037}00037\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00038}00038\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00039}00039\ \ \ suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.Mode\ =\ UART\_MODE\_TX\_RX;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00040}00040\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00041}00041\ \ \ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\_MspInit}}(\&suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00042}00042\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00043}00043\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00044}00044\ \ \ \textcolor{keywordflow}{if}\ (HAL\_UART\_Init(\&suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}})\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00045}00045\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00046}00046\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00047}00047\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00048}00048\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00049}00049\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00050}00050\ \ \ \textcolor{comment}{//\ init\ gpio\ from\ UARTSettings\ structure}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00051}00051\ \ \ \mbox{\hyperlink{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}{UART\_GPIO\_Init}}(suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_af6f9910d065bae715cdb4a1024143a8f}{GPIOx}},\ suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a3fba2b52788fe453348b5d92ed52ba49}{GPIO\_PIN\_RX}},\ suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a5f1babfcfb436cd77f5614253c0a5bef}{GPIO\_PIN\_TX}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00052}00052\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00053}00053\ \ \ \_\_HAL\_UART\_ENABLE\_IT(\&suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}},\ UART\_IT\_IDLE);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00054}00054\ \ \ \textcolor{comment}{//\ init\ dma\ from\ UARTSettings\ structure\ if\ need}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00055}00055\ \ \ \textcolor{keywordflow}{if}\ (suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a1ecc9ac6a1d2747ade56770cbab6a613}{DMAChannel}}\ !=\ 0)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00056}00056\ \ \ \ \ \mbox{\hyperlink{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}{UART\_DMA\_Init}}(\&suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}},\ suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.hdmarx,\ suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a1ecc9ac6a1d2747ade56770cbab6a613}{DMAChannel}},\ suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a15ce92b03f7f189bfbe1ab88a5f94d19}{DMA\_CHANNEL\_X}});}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00057}00057\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00058}00058\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00059}00059\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00060}00060\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00061}00061\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00062}00062\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00063}00063\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00064}00064\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ GPIO\ для\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00065}00065\ \textcolor{comment}{\ \ *\ @param\ \ GPIOx\ \ \ \ \ \ \ Порт\ для\ настройки.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00066}00066\ \textcolor{comment}{\ \ *\ @param\ \ GPIO\_PIN\_RX\ Пин\ для\ приема.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00067}00067\ \textcolor{comment}{\ \ *\ @param\ \ GPIO\_PIN\_TX\ Пин\ для\ передачи.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00068}00068\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00069}\mbox{\hyperlink{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}{00069}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}{UART\_GPIO\_Init}}(GPIO\_TypeDef\ *GPIOx,\ uint16\_t\ GPIO\_PIN\_RX,\ uint16\_t\ GPIO\_PIN\_TX)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00070}00070\ \{\ \textcolor{comment}{//\ function\ takes\ port\ and\ pins\ (for\ rx\ and\ tx)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00071}00071\ \ \ GPIO\_InitTypeDef\ GPIO\_InitStruct\ =\ \{0\};}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00072}00072\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00073}00073\ \ \ \textcolor{comment}{//\ choose\ port\ for\ enable\ clock}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00074}00074\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(GPIOx);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00075}00075\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00076}00076\ \ \ \textcolor{comment}{//USART3\ GPIO\ Configuration}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00077}00077\ \ \ \textcolor{comment}{//GPIO\_PIN\_TX\ -\/-\/-\/-\/-\/-\/>\ USART\_TX}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00078}00078\ \ \ \textcolor{comment}{//GPIO\_PIN\_RX\ -\/-\/-\/-\/-\/-\/>\ USART\_RX\ \ \ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00079}00079\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00080}00080\ \textcolor{preprocessor}{\#if\ defined(STM32F4xx)\ }\textcolor{comment}{//\ gpio\ init\ for\ 407}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00081}00081\ \ \ GPIO\_InitStruct.Pin\ =\ GPIO\_PIN\_TX|GPIO\_PIN\_RX;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00082}00082\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00083}00083\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_NOPULL;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00084}00084\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_VERY\_HIGH;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00085}00085\ \ \ GPIO\_InitStruct.Alternate\ =\ GPIO\_AF7\_USART3;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00086}00086\ \ \ HAL\_GPIO\_Init(GPIOx,\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00087}00087\ \textcolor{preprocessor}{\#elif\ defined(STM32F1xx)\ \ }\textcolor{comment}{//\ gpio\ init\ for\ atm403/stm103}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00088}00088\ \ \ \textcolor{comment}{//GPIO\_PIN\_TX\ -\/-\/-\/-\/-\/-\/>\ USART\_TX}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00089}00089\ \ \ GPIO\_InitStruct.Pin\ =\ GPIO\_PIN\_TX;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00090}00090\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00091}00091\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_HIGH;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00092}00092\ \ \ HAL\_GPIO\_Init(GPIOx,\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00093}00093\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00094}00094\ \textcolor{comment}{//\ \ GPIO\_PIN\_RX\ -\/-\/-\/-\/-\/-\/>\ USART\_RX\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00095}00095\ \ \ GPIO\_InitStruct.Pin\ =\ GPIO\_PIN\_RX;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00096}00096\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_INPUT;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00097}00097\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_NOPULL;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00098}00098\ \ \ HAL\_GPIO\_Init(GPIOx,\ \&GPIO\_InitStruct);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00099}00099\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00100}00100\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00101}00101\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00102}00102\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00103}00103\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ DMA\ для\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00104}00104\ \textcolor{comment}{\ \ *\ @param\ \ huart\ \ \ \ \ \ \ \ \ Указатель\ на\ хендл\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00105}00105\ \textcolor{comment}{\ \ *\ @param\ \ hdma\_rx\ \ \ \ \ \ \ Указатель\ на\ хендл\ DMA\ для\ линии\ приема\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00106}00106\ \textcolor{comment}{\ \ *\ @param\ \ DMAChannel\ \ \ \ Указатель\ на\ канал\ DMA/поток\ DMA\ в\ STM32F407.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00107}00107\ \textcolor{comment}{\ \ *\ @param\ \ DMA\_CHANNEL\_X\ Канал\ DMA.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00108}00108\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00109}\mbox{\hyperlink{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}{00109}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}{UART\_DMA\_Init}}(UART\_HandleTypeDef\ *huart,\ DMA\_HandleTypeDef\ *hdma\_rx,\ DMA\_Stream\_TypeDef\ *DMAChannel,\ uint32\_t\ DMA\_CHANNEL\_X)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00110}00110\ \{\ \textcolor{comment}{//\ function\ takes\ uart\ and\ dma\ handlers\ and\ dmachannel\ for\ uart}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00111}00111\ \ \ \textcolor{comment}{//\ for\ now\ only\ dma\ rx\ is\ supported,\ tx\ maybe\ later\ if\ needed}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00112}00112\ \ \ \ \ \textcolor{comment}{//\ calc\ defines\ on\ boot\_project\_setup.h}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00113}00113\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00114}00114\ \ \ \textcolor{comment}{/*\ USART3\ DMA\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00115}00115\ \ \ \textcolor{comment}{/*\ USART3\_RX\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00116}00116\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00117}00117\ \ \ hdma\_rx-\/>Instance\ =\ DMAChannel;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00118}00118\ \textcolor{preprocessor}{\#if\ defined(STM32F4xx)\ }\textcolor{comment}{//\ dma\ channel\ choose\ for\ 407}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00119}00119\ \ \ hdma\_rx-\/>Init.Channel\ =\ DMA\_CHANNEL\_X;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00120}00120\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00121}00121\ \ \ hdma\_rx-\/>Init.Direction\ =\ DMA\_PERIPH\_TO\_MEMORY;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00122}00122\ \ \ hdma\_rx-\/>Init.PeriphInc\ =\ DMA\_PINC\_DISABLE;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00123}00123\ \ \ hdma\_rx-\/>Init.MemInc\ =\ DMA\_MINC\_ENABLE;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00124}00124\ \ \ hdma\_rx-\/>Init.PeriphDataAlignment\ =\ DMA\_PDATAALIGN\_BYTE;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00125}00125\ \ \ hdma\_rx-\/>Init.MemDataAlignment\ =\ DMA\_MDATAALIGN\_BYTE;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00126}00126\ \ \ hdma\_rx-\/>Init.Mode\ =\ DMA\_CIRCULAR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00127}00127\ \ \ hdma\_rx-\/>Init.Priority\ =\ DMA\_PRIORITY\_LOW;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00128}00128\ \ \ \textcolor{keywordflow}{if}\ (HAL\_DMA\_Init(hdma\_rx)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00129}00129\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00130}00130\ \ \ \ \ MyLibs\_Error\_Handler();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00131}00131\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00132}00132\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00133}00133\ \ \ \_\_USER\_LINKDMA(huart,hdmarx,hdma\_rx);\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00134}00134\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00135}00135\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00136}00136\ \ \ \textcolor{comment}{//\ \_\_USER\_LINKDMA\ is\ need\ because\ \_\_HAL\_LINKDMA\ is\ written\ for\ global\ defined\ hdma\_rx}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00137}00137\ \ \ \textcolor{comment}{//\ so\ you\ get\ error\ because\ hal\ uses\ .\ insted\ of\ -\/>}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00138}00138\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00139}00139\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00140}00140\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00141}00141\ \textcolor{comment}{\ \ *\ @brief\ \ Настройка\ тактирования\ и\ прерываний\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00142}00142\ \textcolor{comment}{\ \ *\ @param\ \ huart\ Указатель\ на\ хендл\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00143}00143\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ иницилизацией\ неиспользуемых\ UART,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00144}00144\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ UART\_INIT\ в\ @ref\ general\_uart.h\ определяются\ используемые\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00145}00145\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00146}\mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{00146}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\_MspInit}}(UART\_HandleTypeDef\ *huart)\ \textcolor{comment}{//\ analog\ for\ hal\ function}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00147}00147\ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00148}00148\ \textcolor{comment}{//\ \ \_\_RCC\_DMA\_UART\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00149}00149\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00150}00150\ \textcolor{comment}{//\ \ /*\ DMA1\_Stream1\_IRQn\ interrupt\ configuration\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00151}00151\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA\_UART\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00152}00152\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA\_UART\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00153}00153\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00154}00154\ \ \ \textcolor{comment}{//\ rcc,\ dma\ and\ interrupt\ init\ for\ USARTs}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00155}00155\ \ \ \textcolor{comment}{//\ GPIO\ init\ was\ moved\ to\ own\ functions\ UART\_GPIO\_Init\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00156}00156\ \ \ \textcolor{keywordflow}{if}(0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00157}00157\ \textcolor{preprocessor}{\#ifdef\ USE\_USART1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00158}00158\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00159}00159\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00160}00160\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00161}00161\ \ \ \textcolor{comment}{/*\ DMA2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00162}00162\ \ \ \_\_HAL\_RCC\_DMA2\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00163}00163\ \ \ \textcolor{comment}{/*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00164}00164\ \ \ HAL\_NVIC\_SetPriority(DMA2\_Stream2\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00165}00165\ \ \ HAL\_NVIC\_EnableIRQ(DMA2\_Stream2\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00166}00166\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00167}00167\ \ \ \textcolor{comment}{/*\ USART1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00168}00168\ \ \ \_\_HAL\_RCC\_USART1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00169}00169\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00170}00170\ \ \ \textcolor{comment}{/*\ USART1\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00171}00171\ \ \ HAL\_NVIC\_SetPriority(USART1\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00172}00172\ \ \ HAL\_NVIC\_EnableIRQ(USART1\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00173}00173\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00174}00174\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00175}00175\ \textcolor{preprocessor}{\#ifdef\ USE\_USART2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00176}00176\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART2)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00177}00177\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00178}00178\ \ \ \textcolor{comment}{/*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00179}00179\ \ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00180}00180\ \ \ \textcolor{comment}{/*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00181}00181\ \ \ HAL\_NVIC\_SetPriority(DMA1\_Stream5\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00182}00182\ \ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream5\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00183}00183\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00184}00184\ \ \ \textcolor{comment}{/*\ USART2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00185}00185\ \ \ \_\_HAL\_RCC\_USART2\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00186}00186\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00187}00187\ \ \ \textcolor{comment}{/*\ USART2\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00188}00188\ \ \ HAL\_NVIC\_SetPriority(USART2\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00189}00189\ \ \ HAL\_NVIC\_EnableIRQ(USART2\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00190}00190\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00191}00191\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00192}00192\ \textcolor{preprocessor}{\#ifdef\ USE\_USART3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00193}00193\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART3)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00194}00194\ \ \ \{\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00195}00195\ \ \ \textcolor{comment}{/*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00196}00196\ \ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00197}00197\ \ \ \textcolor{comment}{/*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00198}00198\ \ \ HAL\_NVIC\_SetPriority(DMA1\_Stream1\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00199}00199\ \ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream1\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00200}00200\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00201}00201\ \ \ \textcolor{comment}{/*\ USART3\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00202}00202\ \ \ \_\_HAL\_RCC\_USART3\_CLK\_ENABLE();\ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00203}00203\ \ \ \textcolor{comment}{/*\ USART3\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00204}00204\ \ \ HAL\_NVIC\_SetPriority(USART3\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00205}00205\ \ \ HAL\_NVIC\_EnableIRQ(USART3\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00206}00206\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00207}00207\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00208}00208\ \textcolor{preprocessor}{\#ifdef\ USE\_UART4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00209}00209\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==UART4)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00210}00210\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00211}00211\ \ \ \textcolor{comment}{/*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00212}00212\ \ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00213}00213\ \ \ \textcolor{comment}{/*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00214}00214\ \ \ HAL\_NVIC\_SetPriority(DMA1\_Stream2\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00215}00215\ \ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream2\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00216}00216\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00217}00217\ \ \ \textcolor{comment}{/*\ UART4\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00218}00218\ \ \ \_\_HAL\_RCC\_UART4\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00219}00219\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00220}00220\ \ \ \textcolor{comment}{/*\ UART4\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00221}00221\ \ \ HAL\_NVIC\_SetPriority(UART4\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00222}00222\ \ \ HAL\_NVIC\_EnableIRQ(UART4\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00223}00223\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00224}00224\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_UART4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00225}00225\ \textcolor{preprocessor}{\#ifdef\ USE\_UART5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00226}00226\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==UART5)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00227}00227\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00228}00228\ \ \ \textcolor{comment}{/*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00229}00229\ \ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00230}00230\ \ \ \textcolor{comment}{/*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00231}00231\ \ \ HAL\_NVIC\_SetPriority(DMA1\_Stream0\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00232}00232\ \ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream0\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00233}00233\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00234}00234\ \ \ \textcolor{comment}{/*\ UART5\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00235}00235\ \ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00236}00236\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00237}00237\ \ \ \textcolor{comment}{/*\ UART5\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00238}00238\ \ \ HAL\_NVIC\_SetPriority(UART5\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00239}00239\ \ \ HAL\_NVIC\_EnableIRQ(UART5\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00240}00240\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00241}00241\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_UART5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00242}00242\ \textcolor{preprocessor}{\#ifdef\ USE\_USART6}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00243}00243\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART6)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00244}00244\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00245}00245\ \ \ \textcolor{comment}{/*\ DMA2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00246}00246\ \ \ \_\_HAL\_RCC\_DMA2\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00247}00247\ \ \ \textcolor{comment}{/*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00248}00248\ \ \ HAL\_NVIC\_SetPriority(DMA2\_Stream1\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00249}00249\ \ \ HAL\_NVIC\_EnableIRQ(DMA2\_Stream1\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00250}00250\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00251}00251\ \ \ \textcolor{comment}{/*\ USART6\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00252}00252\ \ \ \_\_HAL\_RCC\_USART6\_CLK\_ENABLE();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00253}00253\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00254}00254\ \ \ \textcolor{comment}{/*\ USART6\ interrupt\ Init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00255}00255\ \ \ HAL\_NVIC\_SetPriority(USART6\_IRQn,\ 0,\ 0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00256}00256\ \ \ HAL\_NVIC\_EnableIRQ(USART6\_IRQn);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00257}00257\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00258}00258\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART6}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00259}00259\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00260}00260\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00261}00261\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00262}00262\ \textcolor{comment}{\ \ *\ @brief\ \ Деинициализация\ тактирования\ и\ прерываний\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00263}00263\ \textcolor{comment}{\ \ *\ @param\ \ huart\ Указатель\ на\ хендл\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00264}00264\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ деиницилизацией\ неиспользуемых\ UART,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00265}00265\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ UART\_INIT\ в\ @ref\ general\_uart.h\ определяются\ используемые\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00266}00266\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00267}\mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}{00267}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}{UART\_MspDeInit}}(UART\_HandleTypeDef\ *huart)\ \textcolor{comment}{//\ analog\ for\ hal\ function}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00268}00268\ \{\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00269}00269\ \ \ \textcolor{comment}{//\ rcc,\ dma\ and\ interrupt\ init\ for\ USARTs}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00270}00270\ \ \ \textcolor{comment}{//\ GPIO\ init\ was\ moved\ to\ own\ functions\ UART\_GPIO\_Init\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00271}00271\ \ \ \textcolor{keywordflow}{if}(0);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00272}00272\ \textcolor{preprocessor}{\#ifdef\ USE\_USART1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00273}00273\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART1)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00274}00274\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00275}00275\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00276}00276\ \textcolor{comment}{//\ \ /*\ DMA2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00277}00277\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA2\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00278}00278\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00279}00279\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA2\_Stream2\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00280}00280\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA2\_Stream2\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00281}00281\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00282}00282\ \ \ \textcolor{comment}{/*\ USART1\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00283}00283\ \ \ \_\_HAL\_RCC\_USART1\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00284}00284\ \ \ \_\_HAL\_RCC\_USART1\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00285}00285\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00286}00286\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART1}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00287}00287\ \textcolor{preprocessor}{\#ifdef\ USE\_USART2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00288}00288\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART2)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00289}00289\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00290}00290\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00291}00291\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00292}00292\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00293}00293\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream5\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00294}00294\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream5\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00295}00295\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00296}00296\ \ \ \textcolor{comment}{/*\ USART2\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00297}00297\ \ \ \_\_HAL\_RCC\_USART2\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00298}00298\ \ \ \_\_HAL\_RCC\_USART2\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00299}00299\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00300}00300\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART2}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00301}00301\ \textcolor{preprocessor}{\#ifdef\ USE\_USART3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00302}00302\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART3)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00303}00303\ \ \ \{\ \ \ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00304}00304\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00305}00305\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00306}00306\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00307}00307\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream1\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00308}00308\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream1\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00309}00309\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00310}00310\ \ \ \textcolor{comment}{/*\ USART3\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00311}00311\ \ \ \_\_HAL\_RCC\_USART3\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00312}00312\ \ \ \_\_HAL\_RCC\_USART3\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00313}00313\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00314}00314\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART3}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00315}00315\ \textcolor{preprocessor}{\#ifdef\ USE\_UART4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00316}00316\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==UART4)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00317}00317\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00318}00318\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00319}00319\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00320}00320\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00321}00321\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream2\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00322}00322\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream2\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00323}00323\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00324}00324\ \ \ \textcolor{comment}{/*\ UART4\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00325}00325\ \ \ \_\_HAL\_RCC\_UART4\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00326}00326\ \ \ \_\_HAL\_RCC\_UART4\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00327}00327\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00328}00328\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_UART4}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00329}00329\ \textcolor{preprocessor}{\#ifdef\ USE\_UART5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00330}00330\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==UART5)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00331}00331\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00332}00332\ \textcolor{comment}{//\ \ /*\ DMA1\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00333}00333\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA1\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00334}00334\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00335}00335\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA1\_Stream0\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00336}00336\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA1\_Stream0\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00337}00337\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00338}00338\ \ \ \textcolor{comment}{/*\ UART5\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00339}00339\ \ \ \_\_HAL\_RCC\_UART5\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00340}00340\ \ \ \_\_HAL\_RCC\_UART5\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00341}00341\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00342}00342\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_UART5}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00343}00343\ \textcolor{preprocessor}{\#ifdef\ USE\_USART6}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00344}00344\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}(huart-\/>Instance==USART6)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00345}00345\ \ \ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00346}00346\ \textcolor{comment}{//\ \ /*\ DMA2\ clock\ enable\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00347}00347\ \textcolor{comment}{//\ \ \_\_HAL\_RCC\_DMA2\_CLK\_ENABLE();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00348}00348\ \textcolor{comment}{//\ \ /*\ DMA\ interrupt\ init\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00349}00349\ \textcolor{comment}{//\ \ HAL\_NVIC\_SetPriority(DMA2\_Stream1\_IRQn,\ 0,\ 0);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00350}00350\ \textcolor{comment}{//\ \ HAL\_NVIC\_EnableIRQ(DMA2\_Stream1\_IRQn);}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00351}00351\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00352}00352\ \ \ \textcolor{comment}{/*\ USART6\ clock\ reset\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00353}00353\ \ \ \_\_HAL\_RCC\_USART6\_FORCE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00354}00354\ \ \ \_\_HAL\_RCC\_USART6\_RELEASE\_RESET();}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00355}00355\ \ \ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00356}00356\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ USE\_USART6}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00357}00357\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00358}00358\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00359}00359\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00360}00360\ \textcolor{comment}{\ \ *\ @brief\ \ Проверка\ корректности\ структуры\ инициализации\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00361}00361\ \textcolor{comment}{\ \ *\ @param\ \ suart\ Указатель\ на\ структуру\ с\ настройками\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00362}00362\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00363}00363\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00364}\mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}{00364}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}{UART\_Check\_Init\_Struct}}(\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart)}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00365}00365\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00366}00366\ \ \ \textcolor{comment}{//\ check\ is\ settings\ are\ valid}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00367}00367\ \ \ \textcolor{keywordflow}{if}\ (!IS\_UART\_INSTANCE(suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Instance))}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00368}00368\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00369}00369\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00370}00370\ \ \ \textcolor{keywordflow}{if}\ (!IS\_UART\_BAUDRATE(suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.BaudRate)\ ||\ (suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.BaudRate\ ==\ NULL))}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00371}00371\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00372}00372\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00373}00373\ \ \ \textcolor{keywordflow}{if}\ (!IS\_GPIO\_ALL\_INSTANCE(suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_af6f9910d065bae715cdb4a1024143a8f}{GPIOx}}))}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00374}00374\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00375}00375\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00376}00376\ \ \ \textcolor{keywordflow}{if}\ (!IS\_GPIO\_PIN(suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a3fba2b52788fe453348b5d92ed52ba49}{GPIO\_PIN\_RX}})\ \&\&\ !IS\_GPIO\_PIN(suart-\/>\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a5f1babfcfb436cd77f5614253c0a5bef}{GPIO\_PIN\_TX}}))\ \textcolor{comment}{//\ if\ both\ pins\ arent\ set\ up}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00377}00377\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00378}00378\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00379}00379\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00380}00380\ \}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00381}00381\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00382}00382\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/UART\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8c_source_l00383}00383\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
|
||||
\end{DoxyCode}
|
||||
64
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h.tex
Normal file
64
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h.tex
Normal file
@@ -0,0 +1,64 @@
|
||||
\doxysection{E\+:/.WORK/\+STM32/\+STM\+\_\+\+Libs/\+STM32\+\_\+\+General/\+Inc/general\+\_\+uart.h File Reference}
|
||||
\hypertarget{general__uart_8h}{}\label{general__uart_8h}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_uart.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_uart.h}}
|
||||
|
||||
|
||||
Заголовочный файл для модуля инициализации UART.
|
||||
|
||||
|
||||
{\ttfamily \#include "{}mylibs\+\_\+defs.\+h"{}}\newline
|
||||
Include dependency graph for general\+\_\+uart.\+h\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__uart_8h__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
This graph shows which files directly or indirectly include this file\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=202pt]{general__uart_8h__dep__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура настроек UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Macros}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga167269406e73327b95c3bb7b9cfe6d89}{HAL\+\_\+\+UART\+\_\+\+MODULE\+\_\+\+ENABLED}}
|
||||
\begin{DoxyCompactList}\small\item\em Включение HAL UART. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_gace54f148bb1d72f13bf397d096d38d1b}{USE\+\_\+\+USART1}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить USART1 в \doxylink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_gaacb3968508217a0d8b3f64aa0c8aa07d}{USE\+\_\+\+USART2}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить USART2 в \doxylink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga6dadd967b428aade24008ec060009976}{USE\+\_\+\+USART3}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить USART3 в \doxylink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga779530e93e7aa1f25eb13045ec42b8e7}{USE\+\_\+\+UART4}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить UART4 в \doxylink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga592c6bf4a6496d6806ba0838cdfa2340}{USE\+\_\+\+UART5}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить UART5 в \doxylink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___u_a_r_t___i_n_i_t_gafaeb8bdd4aa7fb1987505530daa90868}{USE\+\_\+\+USART6}}
|
||||
\begin{DoxyCompactList}\small\item\em Включить USART6 в \doxylink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___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
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___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}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___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___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}{UART\+\_\+\+Msp\+De\+Init}} (UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}huart)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Заголовочный файл для модуля инициализации UART.
|
||||
|
||||
|
||||
|
||||
Definition in file \mbox{\hyperlink{general__uart_8h_source}{general\+\_\+uart.\+h}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3fb58d30f0272cdb1f584473a2620857
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h__dep__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h__dep__incl.pdf
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
e723b33bcae9ec70bc034152e4221f62
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h__incl.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h__incl.pdf
Normal file
Binary file not shown.
163
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h_source.tex
Normal file
163
AllLibs/PeriphGeneral/Doc/latex/general__uart_8h_source.tex
Normal file
@@ -0,0 +1,163 @@
|
||||
\doxysection{general\+\_\+uart.\+h}
|
||||
\hypertarget{general__uart_8h_source}{}\label{general__uart_8h_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_uart.h@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Inc/general\_uart.h}}
|
||||
\mbox{\hyperlink{general__uart_8h}{Go to the documentation of this file.}}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00001}00001\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_uart.h}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Заголовочный\ файл\ для\ модуля\ инициализации\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00006}00006\ \textcolor{comment}{*\ @defgroup\ GENERAL\_UART\ \ \ \ \ \ UART\ Tools}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ STM32\_GENERAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00008}00008\ \textcolor{comment}{*\ @brief\ \ \ \ Функции\ и\ макросы\ для\ удобной\ работы\ с\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00009}00009\ \textcolor{comment}{*\ @details}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00010}00010\ \textcolor{comment}{Модуль\ предоставляет\ функции\ для\ базовой\ инициализации\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00011}00011\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00012}00012\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00013}00013\ \textcolor{comment}{@par\ Пример\ использования:}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00014}00014\ \textcolor{comment}{@code}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00015}00015\ \textcolor{comment}{//\ Структура\ настроек\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00016}00016\ \textcolor{comment}{UART\_SettingsTypeDef\ uart2Settings;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00017}00017\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00018}00018\ \textcolor{comment}{void\ UART2\_Init(void)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00019}00019\ \textcolor{comment}{\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00020}00020\ \textcolor{comment}{\ \ \ \ //\ Настройка\ UART2\ с\ 115200\ бод,\ 8\ бит,\ 1\ стоп-\/бит,\ без\ паритета}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00021}00021\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Instance\ =\ USART2;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00022}00022\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.BaudRate\ =\ 115200;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00023}00023\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.WordLength\ =\ UART\_WORDLENGTH\_8B;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00024}00024\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.StopBits\ =\ UART\_STOPBITS\_1;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00025}00025\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.Parity\ =\ UART\_PARITY\_NONE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00026}00026\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.Mode\ =\ UART\_MODE\_TX\_RX;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00027}00027\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.HwFlowCtl\ =\ UART\_HWCONTROL\_NONE;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00028}00028\ \textcolor{comment}{\ \ \ \ uart2Settings.huart.Init.OverSampling\ =\ UART\_OVERSAMPLING\_16;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00029}00029\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00030}00030\ \textcolor{comment}{\ \ \ \ //\ Настройка\ GPIO}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00031}00031\ \textcolor{comment}{\ \ \ \ uart2Settings.GPIOx\ =\ GPIOA;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00032}00032\ \textcolor{comment}{\ \ \ \ uart2Settings.GPIO\_PIN\_TX\ =\ GPIO\_PIN\_2;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00033}00033\ \textcolor{comment}{\ \ \ \ uart2Settings.GPIO\_PIN\_RX\ =\ GPIO\_PIN\_3;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00034}00034\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00035}00035\ \textcolor{comment}{\ \ \ \ //\ DMA\ не\ используется\ в\ этом\ примере}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00036}00036\ \textcolor{comment}{\ \ \ \ uart2Settings.DMAChannel\ =\ NULL;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00037}00037\ \textcolor{comment}{\ \ \ \ uart2Settings.DMA\_CHANNEL\_X\ =\ 0;}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00038}00038\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00039}00039\ \textcolor{comment}{\ \ \ \ //\ Инициализация\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00040}00040\ \textcolor{comment}{\ \ \ \ if(UART\_Base\_Init(\&uart2Settings)\ !=\ HAL\_OK)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00041}00041\ \textcolor{comment}{\ \ \ \ \{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00042}00042\ \textcolor{comment}{\ \ \ \ \ \ \ \ //\ Обработка\ ошибки}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00043}00043\ \textcolor{comment}{\ \ \ \ \ \ \ \ Error\_Handler();}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00044}00044\ \textcolor{comment}{\ \ \ \ \}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00045}00045\ \textcolor{comment}{\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00046}00046\ \textcolor{comment}{@endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00047}00047\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00048}00048\ \textcolor{comment}{*\ \ @note\ Требуется\ подключение\ модуля\ UART\ в\ библиотеке\ HAL\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00049}00049\ \textcolor{comment}{@code\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00050}00050\ \textcolor{comment}{\#define\ HAL\_UART\_MODULE\_ENABLED}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00051}00051\ \textcolor{comment}{@endcode}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00052}00052\ \textcolor{comment}{*\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00053}00053\ \textcolor{comment}{*************************************************************************/}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00054}00054\ \textcolor{preprocessor}{\#ifndef\ \_\_UART\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00055}00055\ \textcolor{preprocessor}{\#define\ \_\_UART\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00056}00056\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00057}00057\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00058}00058\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00059}00059\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00060}00060\ \textcolor{comment}{\ \ *\ @addtogroup\ UART\_INIT\ UART\ Init\ defines}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00061}00061\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00062}00062\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ GENERAL\_CONFIGS\ Конфигурации\ STM32\ General}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00063}00063\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Настройка\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00064}00064\ \textcolor{comment}{\ \ *\ @\{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00065}00065\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00066}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga167269406e73327b95c3bb7b9cfe6d89}{00066}}\ \textcolor{preprocessor}{\#define\ HAL\_UART\_MODULE\_ENABLED\ \ \ }\textcolor{comment}{///<\ Включение\ HAL\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00067}00067\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00068}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_gace54f148bb1d72f13bf397d096d38d1b}{00068}}\ \textcolor{preprocessor}{\#define\ USE\_USART1\ \ \ \ }\textcolor{comment}{///<\ Включить\ USART1\ в\ @ref\ UART\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00069}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_gaacb3968508217a0d8b3f64aa0c8aa07d}{00069}}\ \textcolor{preprocessor}{\#define\ USE\_USART2\ \ \ \ }\textcolor{comment}{///<\ Включить\ USART2\ в\ @ref\ UART\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00070}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga6dadd967b428aade24008ec060009976}{00070}}\ \textcolor{preprocessor}{\#define\ USE\_USART3\ \ \ \ }\textcolor{comment}{///<\ Включить\ USART3\ в\ @ref\ UART\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00071}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga779530e93e7aa1f25eb13045ec42b8e7}{00071}}\ \textcolor{preprocessor}{\#define\ USE\_UART4\ \ \ \ \ }\textcolor{comment}{///<\ Включить\ UART4\ в\ @ref\ UART\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00072}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_ga592c6bf4a6496d6806ba0838cdfa2340}{00072}}\ \textcolor{preprocessor}{\#define\ USE\_UART5\ \ \ \ \ }\textcolor{comment}{///<\ Включить\ UART5\ в\ @ref\ UART\_MspInit}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00073}\mbox{\hyperlink{group___u_a_r_t___i_n_i_t_gafaeb8bdd4aa7fb1987505530daa90868}{00073}}\ \textcolor{preprocessor}{\#define\ USE\_USART6\ \ \ \ }\textcolor{comment}{///<\ Включить\ USART6\ в\ @ref\ UART\_MspInit}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00074}00074\ \textcolor{comment}{/**\ UART\_INIT}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00075}00075\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00076}00076\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00077}00077\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00078}00078\ \textcolor{preprocessor}{\#include\ "{}mylibs\_defs.h"{}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00079}00079\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00080}00080\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00081}00081\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00082}00082\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00083}00083\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00084}00084\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00085}00085\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00086}00086\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00087}00087\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00088}00088\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00089}00089\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00090}00090\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00091}00091\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00092}00092\ \textcolor{comment}{/**}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00093}00093\ \textcolor{comment}{\ \ *\ @brief\ Структура\ настроек\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00094}00094\ \textcolor{comment}{\ \ *\ @details\ Содержит\ все\ необходимые\ параметры\ для\ инициализации\ UART,}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00095}00095\ \textcolor{comment}{\ \ *\ включая\ GPIO\ и\ DMA.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00096}00096\ \textcolor{comment}{\ \ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00097}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{00097}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00098}00098\ \{}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00099}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{00099}}\ \ \ UART\_HandleTypeDef\ \mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ HAL\ handle\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00100}00100\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00101}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_af6f9910d065bae715cdb4a1024143a8f}{00101}}\ \ \ GPIO\_TypeDef\ *\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_af6f9910d065bae715cdb4a1024143a8f}{GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ для\ UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00102}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a3fba2b52788fe453348b5d92ed52ba49}{00102}}\ \ \ uint16\_t\ \mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a3fba2b52788fe453348b5d92ed52ba49}{GPIO\_PIN\_RX}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ приема}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00103}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a5f1babfcfb436cd77f5614253c0a5bef}{00103}}\ \ \ uint16\_t\ \mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a5f1babfcfb436cd77f5614253c0a5bef}{GPIO\_PIN\_TX}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ передачи}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00104}00104\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00105}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a1ecc9ac6a1d2747ade56770cbab6a613}{00105}}\ \ \ DMA\_Stream\_TypeDef\ *\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a1ecc9ac6a1d2747ade56770cbab6a613}{DMAChannel}};\ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Канал\ DMA\ (NULL\ если\ не\ нужен)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00106}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a15ce92b03f7f189bfbe1ab88a5f94d19}{00106}}\ \ \ uint32\_t\ \mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a15ce92b03f7f189bfbe1ab88a5f94d19}{DMA\_CHANNEL\_X}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Номер\ канала\ DMA\ (0\ если\ не\ нужен)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00107}00107\ \ \ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00108}00108\ \}\ \mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}};}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00109}00109\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00110}00110\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00111}00111\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00112}00112\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00113}00113\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00114}00114\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00115}00115\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00116}00116\ \textcolor{comment}{/*\ Инициализация\ UART\ с\ использованием\ структуры\ настроек\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00117}00117\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9f07396b778505c934143e89953e154}{UART\_Base\_Init}}(\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00118}00118\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00119}00119\ \textcolor{comment}{/*\ Проверка\ корректности\ структуры\ настроек\ UART\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00120}00120\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}{UART\_Check\_Init\_Struct}}(\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00121}00121\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00122}00122\ \textcolor{comment}{/*\ Инициализация\ тактирования\ и\ прерываний\ для\ выбранного\ UART\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00123}00123\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\_MspInit}}(UART\_HandleTypeDef\ *huart);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00124}00124\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00125}00125\ \textcolor{comment}{/*\ Деинициализация\ тактирования\ и\ прерываний\ для\ выбранного\ UART\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00126}00126\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}{UART\_MspDeInit}}(UART\_HandleTypeDef\ *huart);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00127}00127\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00128}00128\ \ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00129}00129\ \textcolor{comment}{/**\ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00130}00130\ \textcolor{comment}{\ *\ @cond\ UART\_INTERNAL}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00131}00131\ \textcolor{comment}{\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00132}00132\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00133}00133\ \textcolor{comment}{/*\ Настройка\ GPIO\ для\ UART\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00134}00134\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}{UART\_GPIO\_Init}}(GPIO\_TypeDef\ *GPIOx,\ uint16\_t\ GPIO\_PIN\_RX,\ uint16\_t\ GPIO\_PIN\_TX);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00135}00135\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00136}00136\ \textcolor{comment}{/*\ Настройка\ DMA\ для\ UART\ */}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00137}00137\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}{UART\_DMA\_Init}}(UART\_HandleTypeDef\ *huart,\ DMA\_HandleTypeDef\ *hdma\_rx,\ DMA\_Stream\_TypeDef\ *DMAChannel,\ uint32\_t\ DMA\_CHANNEL\_X);}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00138}00138\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00139}00139\ \textcolor{preprocessor}{\#ifndef\ \_\_USER\_LINKDMA}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00140}00140\ \textcolor{comment}{/**\ \ }}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00141}00141\ \textcolor{comment}{\ \ *\ @brief\ \ Аналог\ HAL\ макроса\ для\ привязки\ DMA\ к\ UART.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00142}00142\ \textcolor{comment}{\ \ *\ @note\ \ \ @ref\ \_\_HAL\_LINKDMA.}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00143}00143\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00144}00144\ \textcolor{preprocessor}{\#define\ \_\_USER\_LINKDMA(\_\_HANDLE\_\_,\ \_\_PPP\_DMA\_FIELD\_\_,\ \_\_DMA\_HANDLE\_\_)\ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00145}00145\ \textcolor{preprocessor}{do\{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00146}00146\ \textcolor{preprocessor}{(\_\_HANDLE\_\_)-\/>\_\_PPP\_DMA\_FIELD\_\_\ =\ (\_\_DMA\_HANDLE\_\_);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00147}00147\ \textcolor{preprocessor}{(\_\_DMA\_HANDLE\_\_)-\/>Parent\ =\ (\_\_HANDLE\_\_);\}\ while(0U)}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00148}00148\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00149}00149\ \ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00150}00150\ \textcolor{comment}{/**\ @endcond\ */}\textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00151}00151\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00152}00152\ }
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00153}00153\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_UART\_GENERAL\_H\_}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00154}00154\ \textcolor{comment}{}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00155}00155\ \textcolor{comment}{/**\ GENERAL\_UART}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00156}00156\ \textcolor{comment}{\ \ *\ @\}}}
|
||||
\DoxyCodeLine{\Hypertarget{general__uart_8h_source_l00157}00157\ \textcolor{comment}{\ \ */}}
|
||||
|
||||
\end{DoxyCode}
|
||||
@@ -0,0 +1 @@
|
||||
eadcf81c05b9b6f04656fb13d3e1bc6b
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
\doxysection{General Configs }
|
||||
\hypertarget{group___g_e_n_e_r_a_l___c_o_n_f_i_g_s}{}\label{group___g_e_n_e_r_a_l___c_o_n_f_i_g_s}\index{General Configs@{General Configs}}
|
||||
Collaboration diagram for General Configs\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=297pt]{group___g_e_n_e_r_a_l___c_o_n_f_i_g_s}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___g_p_i_o___i_n_i_t}{GPIO Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка состояний кнопок и количества тиков в периоде ШИМ \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___s_p_i___i_n_i_t}{SPI Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка SPI. \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___t_i_m___i_n_i_t}{TIM Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка таймеров \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___u_a_r_t___i_n_i_t}{UART Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
@@ -0,0 +1 @@
|
||||
494c79f4a7f3be6d92ca6d4880589b57
|
||||
Binary file not shown.
@@ -0,0 +1,36 @@
|
||||
\doxysection{GPIO Tools }
|
||||
\hypertarget{group___g_e_n_e_r_a_l___g_p_i_o}{}\label{group___g_e_n_e_r_a_l___g_p_i_o}\index{GPIO Tools@{GPIO Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с GPIO.
|
||||
|
||||
|
||||
Collaboration diagram for GPIO Tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=256pt]{group___g_e_n_e_r_a_l___g_p_i_o}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}{General tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Общие функции/макросы для работы с GPIO. \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}{Switch tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для работы с GPIO, как с кнопкой \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}{LED tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для работы с GPIO, для управления светодиодом \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с GPIO.
|
||||
|
||||
Модуль предоставляет универсальные инструменты для работы с GPIO)\+:
|
||||
\begin{DoxyItemize}
|
||||
\item \doxylink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}{General tools} — инициализация и общие функции работы с портами.
|
||||
\item \doxylink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}{Switch tools} — работа с GPIO как с кнопкой\+: чтение состояния, фильтрация дребезга, настройка активного уровня.
|
||||
\item \doxylink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}{LED tools} — работа с GPIO как со светодиодом\+: включение, выключение, моргание и плавное затухание.
|
||||
\end{DoxyItemize}\input{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}
|
||||
\input{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}
|
||||
\input{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}
|
||||
@@ -0,0 +1 @@
|
||||
a12f848eb82749d110eba36ce5ce6b8d
|
||||
Binary file not shown.
@@ -0,0 +1,195 @@
|
||||
\doxysection{SPI Tools }
|
||||
\hypertarget{group___g_e_n_e_r_a_l___s_p_i}{}\label{group___g_e_n_e_r_a_l___s_p_i}\index{SPI Tools@{SPI Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с SPI.
|
||||
|
||||
|
||||
Collaboration diagram for SPI Tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=258pt]{group___g_e_n_e_r_a_l___s_p_i}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___s_p_i___i_n_i_t}{SPI Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура настроек SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация SPI с помощью структуры \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Проверка корректности структуры инициализации SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Настройка тактирования и прерываний SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\+\_\+\+Msp\+De\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с SPI.
|
||||
|
||||
Модуль предоставляет функции для базовой инициализации SPI
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Структура\ настроек\ SPI}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ spi1Settings;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{keywordtype}{void}\ SPI1\_Init(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ SPI1\ как\ Master,\ 8\ бит,\ полный\ дуплекс}}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Instance\ =\ SPI1;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.Mode\ =\ SPI\_MODE\_MASTER;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.Direction\ =\ SPI\_DIRECTION\_2LINES;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.DataSize\ =\ SPI\_DATASIZE\_8BIT;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CLKPolarity\ =\ SPI\_POLARITY\_LOW;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CLKPhase\ =\ SPI\_PHASE\_1EDGE;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.NSS\ =\ SPI\_NSS\_SOFT;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.BaudRatePrescaler\ =\ SPI\_BAUDRATEPRESCALER\_16;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.FirstBit\ =\ SPI\_FIRSTBIT\_MSB;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.TIMode\ =\ SPI\_TIMODE\_DISABLE;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CRCCalculation\ =\ SPI\_CRCCALCULATION\_DISABLE;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ GPIO}}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{CLK\_PIN}}\ =\ GPIO\_PIN\_5;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{CLK\_GPIO\_AlternageFunc}}\ =\ GPIO\_AF5\_SPI1;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{MISO\_PIN}}\ =\ GPIO\_PIN\_6;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{MISO\_GPIO\_AlternageFunc}}\ =\ GPIO\_AF5\_SPI1;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{MOSI\_PIN}}\ =\ GPIO\_PIN\_7;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{MOSI\_GPIO\_AlternageFunc}}\ =\ GPIO\_AF5\_SPI1;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Инициализация\ SPI}}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\_Base\_Init}}(\&spi1Settings)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\ \ \ \ \{}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ Обработка\ ошибки}}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ Error\_Handler();}
|
||||
\DoxyCodeLine{\ \ \ \ \}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
\begin{DoxyNote}{Note}
|
||||
Требуется подключение модуля SPI в библиотеке HAL
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HAL\_SPI\_MODULE\_ENABLED}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___s_p_i_doc-func-members}
|
||||
\doxysubsection{Function Documentation}
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}\index{SPI Tools@{SPI Tools}!SPI\_Base\_Init@{SPI\_Base\_Init}}
|
||||
\index{SPI\_Base\_Init@{SPI\_Base\_Init}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_Base\_Init()}{SPI\_Base\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}
|
||||
HAL\+\_\+\+Status\+Type\+Def SPI\+\_\+\+Base\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация SPI с помощью структуры \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sspi} & Указатель на структуру с настройками SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
~\newline
|
||||
Инициализирует SPI и его GPIO. Настройка аналогична HAL\+\_\+\+SPI\+\_\+\+Init
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{suart.hspi.Init...}
|
||||
|
||||
\end{DoxyCode}
|
||||
но дополнительно надо прописать пины CLK/\+MISO/\+MOSI \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00028}{28}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}\index{SPI Tools@{SPI Tools}!SPI\_Check\_Init\_Struct@{SPI\_Check\_Init\_Struct}}
|
||||
\index{SPI\_Check\_Init\_Struct@{SPI\_Check\_Init\_Struct}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_Check\_Init\_Struct()}{SPI\_Check\_Init\_Struct()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___s_p_i_ga333dd251bc878931086d48aa932b1a5f}
|
||||
HAL\+\_\+\+Status\+Type\+Def SPI\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Проверка корректности структуры инициализации SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sspi} & Указатель на структуру с настройками SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00246}{246}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}\index{SPI Tools@{SPI Tools}!SPI\_MspInit@{SPI\_MspInit}}
|
||||
\index{SPI\_MspInit@{SPI\_MspInit}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_MspInit()}{SPI\_MspInit()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}
|
||||
void SPI\+\_\+\+Msp\+Init (\begin{DoxyParamCaption}\item[{SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{hspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Настройка тактирования и прерываний SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em hspi} & Указатель на хендл SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых SPI, дефайнами \doxylink{group___s_p_i___i_n_i_t}{SPI Init defines} в \doxylink{general__spi_8h}{general\+\_\+spi.\+h} определяются используемые SPI.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00127}{127}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}\index{SPI Tools@{SPI Tools}!SPI\_MspDeInit@{SPI\_MspDeInit}}
|
||||
\index{SPI\_MspDeInit@{SPI\_MspDeInit}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_MspDeInit()}{SPI\_MspDeInit()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}
|
||||
void SPI\+\_\+\+Msp\+De\+Init (\begin{DoxyParamCaption}\item[{SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{hspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Деинициализация тактирования и прерываний SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em hspi} & Указатель на хендл SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых SPI, дефайнами \doxylink{group___s_p_i___i_n_i_t}{SPI Init defines} в \doxylink{general__spi_8h}{general\+\_\+spi.\+h} определяются используемые SPI.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00191}{191}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\input{group___s_p_i___i_n_i_t}
|
||||
@@ -0,0 +1 @@
|
||||
2040db689f210ef8386535f7ae5772d8
|
||||
Binary file not shown.
@@ -0,0 +1,50 @@
|
||||
\doxysection{TIM Tools }
|
||||
\hypertarget{group___g_e_n_e_r_a_l___t_i_m}{}\label{group___g_e_n_e_r_a_l___t_i_m}\index{TIM Tools@{TIM Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с TIM.
|
||||
|
||||
|
||||
Collaboration diagram for TIM Tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=302pt]{group___g_e_n_e_r_a_l___t_i_m}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}{General tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для базовой инициализации таймеров \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}{Delay tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для формирования задержек с помощью таймеров \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c}{PWM/\+OC Channels tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для инициализации базовых функций каналов таймера \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}{Encoder tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для считывания энкодера \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с TIM.
|
||||
|
||||
Модуль предоставляет универсальные инструменты для работы с TIM\+:
|
||||
\begin{DoxyItemize}
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}{General tools} — базовая инициализация таймеров и прерываний.
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}{Delay tools} — функции задержки через таймеры (blocking и non-\/blocking).
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___o_c}{PWM/\+OC Channels tools} — настройка каналов Output Compare и PWM.
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}{Encoder tools} — работа с энкодерами, чтение положения и кнопки.
|
||||
|
||||
\begin{DoxyNote}{Note}
|
||||
Требуется подключение модуля TIM в библиотеке HAL и GPIO (\doxylink{group___g_e_n_e_r_a_l___g_p_i_o}{GPIO Tools}) из My\+Libs
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HAL\_TIM\_MODULE\_ENABLED}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyNote}
|
||||
|
||||
\end{DoxyItemize}\input{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}
|
||||
\input{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}
|
||||
\input{group___m_y_l_i_b_s___t_i_m___o_c}
|
||||
\input{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}
|
||||
@@ -0,0 +1 @@
|
||||
5a0b4b86b39628fdbc12d7012795e4ed
|
||||
Binary file not shown.
@@ -0,0 +1,193 @@
|
||||
\doxysection{UART Tools }
|
||||
\hypertarget{group___g_e_n_e_r_a_l___u_a_r_t}{}\label{group___g_e_n_e_r_a_l___u_a_r_t}\index{UART Tools@{UART Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с UART.
|
||||
|
||||
|
||||
Collaboration diagram for UART Tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=279pt]{group___g_e_n_e_r_a_l___u_a_r_t}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___u_a_r_t___i_n_i_t}{UART Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура настроек UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___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
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___g_e_n_e_r_a_l___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}\item
|
||||
void \mbox{\hyperlink{group___g_e_n_e_r_a_l___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___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}{UART\+\_\+\+Msp\+De\+Init}} (UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}huart)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с UART.
|
||||
|
||||
Модуль предоставляет функции для базовой инициализации UART
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Структура\ настроек\ UART}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ uart2Settings;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{keywordtype}{void}\ UART2\_Init(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ UART2\ с\ 115200\ бод,\ 8\ бит,\ 1\ стоп-\/бит,\ без\ паритета}}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Instance\ =\ USART2;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.BaudRate\ =\ 115200;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.WordLength\ =\ UART\_WORDLENGTH\_8B;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.StopBits\ =\ UART\_STOPBITS\_1;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.Parity\ =\ UART\_PARITY\_NONE;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.Mode\ =\ UART\_MODE\_TX\_RX;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.HwFlowCtl\ =\ UART\_HWCONTROL\_NONE;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.OverSampling\ =\ UART\_OVERSAMPLING\_16;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ GPIO}}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_af6f9910d065bae715cdb4a1024143a8f}{GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a5f1babfcfb436cd77f5614253c0a5bef}{GPIO\_PIN\_TX}}\ =\ GPIO\_PIN\_2;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a3fba2b52788fe453348b5d92ed52ba49}{GPIO\_PIN\_RX}}\ =\ GPIO\_PIN\_3;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ DMA\ не\ используется\ в\ этом\ примере}}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a1ecc9ac6a1d2747ade56770cbab6a613}{DMAChannel}}\ =\ NULL;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a15ce92b03f7f189bfbe1ab88a5f94d19}{DMA\_CHANNEL\_X}}\ =\ 0;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Инициализация\ UART}}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___g_e_n_e_r_a_l___u_a_r_t_gab9f07396b778505c934143e89953e154}{UART\_Base\_Init}}(\&uart2Settings)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\ \ \ \ \{}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ Обработка\ ошибки}}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ Error\_Handler();}
|
||||
\DoxyCodeLine{\ \ \ \ \}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
\begin{DoxyNote}{Note}
|
||||
Требуется подключение модуля UART в библиотеке HAL
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HAL\_UART\_MODULE\_ENABLED}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___u_a_r_t_doc-func-members}
|
||||
\doxysubsection{Function Documentation}
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___u_a_r_t_gab9f07396b778505c934143e89953e154}\index{UART Tools@{UART Tools}!UART\_Base\_Init@{UART\_Base\_Init}}
|
||||
\index{UART\_Base\_Init@{UART\_Base\_Init}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_Base\_Init()}{UART\_Base\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___u_a_r_t_gab9f07396b778505c934143e89953e154}
|
||||
HAL\+\_\+\+Status\+Type\+Def UART\+\_\+\+Base\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{suart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация UART с помощью структуры \doxylink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em suart} & Указатель на структуру с настройками UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
~\newline
|
||||
Инициализирует UART и его GPIO и при необходимости DMA. Настройка аналогична HAL\+\_\+\+UART\+\_\+\+Init
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{suart.huart.Init...}
|
||||
|
||||
\end{DoxyCode}
|
||||
но дополнительно надо прописать пины RX/\+TX \doxylink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{suart-\/>GPIOx,\ suart-\/>GPIO\_PIN\_RX,\ suart-\/>GPIO\_PIN\_TX}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00032}{32}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}\index{UART Tools@{UART Tools}!UART\_Check\_Init\_Struct@{UART\_Check\_Init\_Struct}}
|
||||
\index{UART\_Check\_Init\_Struct@{UART\_Check\_Init\_Struct}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_Check\_Init\_Struct()}{UART\_Check\_Init\_Struct()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}
|
||||
HAL\+\_\+\+Status\+Type\+Def UART\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{suart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Проверка корректности структуры инициализации UART.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em suart} & Указатель на структуру с настройками UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00364}{364}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}\index{UART Tools@{UART Tools}!UART\_MspInit@{UART\_MspInit}}
|
||||
\index{UART\_MspInit@{UART\_MspInit}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_MspInit()}{UART\_MspInit()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}
|
||||
void UART\+\_\+\+Msp\+Init (\begin{DoxyParamCaption}\item[{UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{huart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Настройка тактирования и прерываний UART.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em huart} & Указатель на хендл UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых UART, дефайнами \doxylink{group___u_a_r_t___i_n_i_t}{UART Init defines} в \doxylink{general__uart_8h}{general\+\_\+uart.\+h} определяются используемые UART.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00146}{146}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\Hypertarget{group___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}\index{UART Tools@{UART Tools}!UART\_MspDeInit@{UART\_MspDeInit}}
|
||||
\index{UART\_MspDeInit@{UART\_MspDeInit}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_MspDeInit()}{UART\_MspDeInit()}}
|
||||
{\footnotesize\ttfamily \label{group___g_e_n_e_r_a_l___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}
|
||||
void UART\+\_\+\+Msp\+De\+Init (\begin{DoxyParamCaption}\item[{UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{huart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Деинициализация тактирования и прерываний UART.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em huart} & Указатель на хендл UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с деиницилизацией неиспользуемых UART, дефайнами \doxylink{group___u_a_r_t___i_n_i_t}{UART Init defines} в \doxylink{general__uart_8h}{general\+\_\+uart.\+h} определяются используемые UART.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00267}{267}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\input{group___u_a_r_t___i_n_i_t}
|
||||
@@ -0,0 +1 @@
|
||||
dfe18bd3aa53972e922c32190b76d589
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/group___g_p_i_o___i_n_i_t.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/group___g_p_i_o___i_n_i_t.pdf
Normal file
Binary file not shown.
128
AllLibs/PeriphGeneral/Doc/latex/group___g_p_i_o___i_n_i_t.tex
Normal file
128
AllLibs/PeriphGeneral/Doc/latex/group___g_p_i_o___i_n_i_t.tex
Normal file
@@ -0,0 +1,128 @@
|
||||
\doxysubsubsection{GPIO Init defines }
|
||||
\hypertarget{group___g_p_i_o___i_n_i_t}{}\label{group___g_p_i_o___i_n_i_t}\index{GPIO Init defines@{GPIO Init defines}}
|
||||
|
||||
|
||||
Настройка состояний кнопок и количества тиков в периоде ШИМ
|
||||
|
||||
|
||||
Collaboration diagram for GPIO Init defines\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=294pt]{group___g_p_i_o___i_n_i_t}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsubsection*{Macros}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}{local\+\_\+time}}()
|
||||
\begin{DoxyCompactList}\small\item\em Локальное время \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\+\_\+\+PWM\+\_\+\+TICKS}}~15
|
||||
\begin{DoxyCompactList}\small\item\em Количество тиков в периоде ШИМ \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}{LED\+\_\+\+ON}}~1
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина для включения светодиода \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}{LED\+\_\+\+OFF}}~0
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина для выключения светодиода \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga19d9e3aced311179a2914e0c9b13d0f9}{SW\+\_\+\+ON}}~1
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина при нажатой кнопке \end{DoxyCompactList}\item
|
||||
\#define \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gacd8900c9ec0efde1da3253b718574067}{SW\+\_\+\+OFF}}~0
|
||||
\begin{DoxyCompactList}\small\item\em Состояние пина при отжатой кнопке \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsubsection{Detailed Description}
|
||||
Настройка состояний кнопок и количества тиков в периоде ШИМ
|
||||
|
||||
|
||||
|
||||
\label{doc-define-members}
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_doc-define-members}
|
||||
\doxysubsubsubsection{Macro Definition Documentation}
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}\index{GPIO Init defines@{GPIO Init defines}!local\_time@{local\_time}}
|
||||
\index{local\_time@{local\_time}!GPIO Init defines@{GPIO Init defines}}
|
||||
\doxysubsubsubsubsection{\texorpdfstring{local\_time}{local\_time}}
|
||||
{\footnotesize\ttfamily \label{group___g_p_i_o___i_n_i_t_ga9c853b02c22f26023c34d1d404b6d653}
|
||||
\#define local\+\_\+time(\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}
|
||||
|
||||
{\bfseries Value\+:}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{HAL\_GetTick()}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
|
||||
Локальное время
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00032}{32}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}\index{GPIO Init defines@{GPIO Init defines}!LED\_PWM\_TICKS@{LED\_PWM\_TICKS}}
|
||||
\index{LED\_PWM\_TICKS@{LED\_PWM\_TICKS}!GPIO Init defines@{GPIO Init defines}}
|
||||
\doxysubsubsubsubsection{\texorpdfstring{LED\_PWM\_TICKS}{LED\_PWM\_TICKS}}
|
||||
{\footnotesize\ttfamily \label{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}
|
||||
\#define LED\+\_\+\+PWM\+\_\+\+TICKS~15}
|
||||
|
||||
|
||||
|
||||
Количество тиков в периоде ШИМ
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00036}{36}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}\index{GPIO Init defines@{GPIO Init defines}!LED\_ON@{LED\_ON}}
|
||||
\index{LED\_ON@{LED\_ON}!GPIO Init defines@{GPIO Init defines}}
|
||||
\doxysubsubsubsubsection{\texorpdfstring{LED\_ON}{LED\_ON}}
|
||||
{\footnotesize\ttfamily \label{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}
|
||||
\#define LED\+\_\+\+ON~1}
|
||||
|
||||
|
||||
|
||||
Состояние пина для включения светодиода
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00040}{40}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}\index{GPIO Init defines@{GPIO Init defines}!LED\_OFF@{LED\_OFF}}
|
||||
\index{LED\_OFF@{LED\_OFF}!GPIO Init defines@{GPIO Init defines}}
|
||||
\doxysubsubsubsubsection{\texorpdfstring{LED\_OFF}{LED\_OFF}}
|
||||
{\footnotesize\ttfamily \label{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}
|
||||
\#define LED\+\_\+\+OFF~0}
|
||||
|
||||
|
||||
|
||||
Состояние пина для выключения светодиода
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00043}{43}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_ga19d9e3aced311179a2914e0c9b13d0f9}\index{GPIO Init defines@{GPIO Init defines}!SW\_ON@{SW\_ON}}
|
||||
\index{SW\_ON@{SW\_ON}!GPIO Init defines@{GPIO Init defines}}
|
||||
\doxysubsubsubsubsection{\texorpdfstring{SW\_ON}{SW\_ON}}
|
||||
{\footnotesize\ttfamily \label{group___g_p_i_o___i_n_i_t_ga19d9e3aced311179a2914e0c9b13d0f9}
|
||||
\#define SW\+\_\+\+ON~1}
|
||||
|
||||
|
||||
|
||||
Состояние пина при нажатой кнопке
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00047}{47}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
\Hypertarget{group___g_p_i_o___i_n_i_t_gacd8900c9ec0efde1da3253b718574067}\index{GPIO Init defines@{GPIO Init defines}!SW\_OFF@{SW\_OFF}}
|
||||
\index{SW\_OFF@{SW\_OFF}!GPIO Init defines@{GPIO Init defines}}
|
||||
\doxysubsubsubsubsection{\texorpdfstring{SW\_OFF}{SW\_OFF}}
|
||||
{\footnotesize\ttfamily \label{group___g_p_i_o___i_n_i_t_gacd8900c9ec0efde1da3253b718574067}
|
||||
\#define SW\+\_\+\+OFF~0}
|
||||
|
||||
|
||||
|
||||
Состояние пина при отжатой кнопке
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00050}{50}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
168597df13c81e6de49219fc648e0df4
|
||||
Binary file not shown.
@@ -0,0 +1,37 @@
|
||||
\doxysection{GPIO Tools }
|
||||
\hypertarget{group___m_y___l_i_b_s___g_p_i_o}{}\label{group___m_y___l_i_b_s___g_p_i_o}\index{GPIO Tools@{GPIO Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с GPIO.
|
||||
|
||||
|
||||
Collaboration diagram for GPIO Tools\+:
|
||||
\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=256pt]{group___m_y___l_i_b_s___g_p_i_o}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}{General tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Общие функции/макросы для работы с GPIO. \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}{Switch tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для работы с GPIO, как с кнопкой \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}{LED tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для работы с GPIO, для управления светодиодом \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с GPIO.
|
||||
|
||||
Модуль предоставляет универсальные инструменты для работы с GPIO)\+:
|
||||
\begin{DoxyItemize}
|
||||
\item \doxylink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}{General tools} — инициализация и общие функции работы с портами.
|
||||
\item \doxylink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}{Switch tools} — работа с GPIO как с кнопкой\+: чтение состояния, фильтрация дребезга, настройка активного уровня.
|
||||
\item \doxylink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}{LED tools} — работа с GPIO как со светодиодом\+: включение, выключение, моргание и плавное затухание.
|
||||
\end{DoxyItemize}\input{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}
|
||||
\input{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}
|
||||
\input{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}
|
||||
@@ -0,0 +1 @@
|
||||
3d60a3f66744d896e378b88229ebd99f
|
||||
Binary file not shown.
@@ -0,0 +1,196 @@
|
||||
\doxysection{SPI Tools }
|
||||
\hypertarget{group___m_y___l_i_b_s___s_p_i}{}\label{group___m_y___l_i_b_s___s_p_i}\index{SPI Tools@{SPI Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с SPI.
|
||||
|
||||
|
||||
Collaboration diagram for SPI Tools\+:
|
||||
\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=238pt]{group___m_y___l_i_b_s___s_p_i}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___s_p_i___i_n_i_t}{Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура настроек SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация SPI с помощью структуры \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_ga333dd251bc878931086d48aa932b1a5f}{SPI\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct}} (\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}sspi)
|
||||
\begin{DoxyCompactList}\small\item\em Проверка корректности структуры инициализации SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\+\_\+\+Msp\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Настройка тактирования и прерываний SPI. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\+\_\+\+Msp\+De\+Init}} (SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hspi)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний SPI. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с SPI.
|
||||
|
||||
Модуль предоставляет функции для базовой инициализации SPI
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Структура\ настроек\ SPI}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}}\ spi1Settings;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{keywordtype}{void}\ SPI1\_Init(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ SPI1\ как\ Master,\ 8\ бит,\ полный\ дуплекс}}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Instance\ =\ SPI1;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.Mode\ =\ SPI\_MODE\_MASTER;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.Direction\ =\ SPI\_DIRECTION\_2LINES;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.DataSize\ =\ SPI\_DATASIZE\_8BIT;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CLKPolarity\ =\ SPI\_POLARITY\_LOW;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CLKPhase\ =\ SPI\_PHASE\_1EDGE;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.NSS\ =\ SPI\_NSS\_SOFT;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.BaudRatePrescaler\ =\ SPI\_BAUDRATEPRESCALER\_16;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.FirstBit\ =\ SPI\_FIRSTBIT\_MSB;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.TIMode\ =\ SPI\_TIMODE\_DISABLE;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}}.Init.CRCCalculation\ =\ SPI\_CRCCALCULATION\_DISABLE;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ GPIO}}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{CLK\_PIN}}\ =\ GPIO\_PIN\_5;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{CLK\_GPIO\_AlternageFunc}}\ =\ GPIO\_AF5\_SPI1;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{MISO\_PIN}}\ =\ GPIO\_PIN\_6;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{MISO\_GPIO\_AlternageFunc}}\ =\ GPIO\_AF5\_SPI1;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{MOSI\_PIN}}\ =\ GPIO\_PIN\_7;}
|
||||
\DoxyCodeLine{\ \ \ \ spi1Settings.\mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{MOSI\_GPIO\_AlternageFunc}}\ =\ GPIO\_AF5\_SPI1;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Инициализация\ SPI}}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}{SPI\_Base\_Init}}(\&spi1Settings)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\ \ \ \ \{}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ Обработка\ ошибки}}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ Error\_Handler();}
|
||||
\DoxyCodeLine{\ \ \ \ \}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
\begin{DoxyNote}{Note}
|
||||
Требуется подключение модуля SPI в библиотеке HAL
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HAL\_SPI\_MODULE\_ENABLED}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y___l_i_b_s___s_p_i_doc-func-members}
|
||||
\doxysubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y___l_i_b_s___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}\index{SPI Tools@{SPI Tools}!SPI\_Base\_Init@{SPI\_Base\_Init}}
|
||||
\index{SPI\_Base\_Init@{SPI\_Base\_Init}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_Base\_Init()}{SPI\_Base\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___s_p_i_ga0e177e3c57a8fcdc73b5602e72ec66ba}
|
||||
HAL\+\_\+\+Status\+Type\+Def SPI\+\_\+\+Base\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация SPI с помощью структуры \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sspi} & Указатель на структуру с настройками SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
~\newline
|
||||
Инициализирует SPI и его GPIO. Настройка аналогична HAL\+\_\+\+SPI\+\_\+\+Init
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{suart.hspi.Init...}
|
||||
|
||||
\end{DoxyCode}
|
||||
но дополнительно надо прописать пины CLK/\+MISO/\+MOSI \doxylink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00028}{28}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y___l_i_b_s___s_p_i_ga333dd251bc878931086d48aa932b1a5f}\index{SPI Tools@{SPI Tools}!SPI\_Check\_Init\_Struct@{SPI\_Check\_Init\_Struct}}
|
||||
\index{SPI\_Check\_Init\_Struct@{SPI\_Check\_Init\_Struct}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_Check\_Init\_Struct()}{SPI\_Check\_Init\_Struct()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___s_p_i_ga333dd251bc878931086d48aa932b1a5f}
|
||||
HAL\+\_\+\+Status\+Type\+Def SPI\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Проверка корректности структуры инициализации SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sspi} & Указатель на структуру с настройками SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00246}{246}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y___l_i_b_s___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}\index{SPI Tools@{SPI Tools}!SPI\_MspInit@{SPI\_MspInit}}
|
||||
\index{SPI\_MspInit@{SPI\_MspInit}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_MspInit()}{SPI\_MspInit()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}
|
||||
void SPI\+\_\+\+Msp\+Init (\begin{DoxyParamCaption}\item[{SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{hspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Настройка тактирования и прерываний SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em hspi} & Указатель на хендл SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых SPI, дефайнами \doxylink{group___s_p_i___i_n_i_t}{Init defines} в \doxylink{general__spi_8h}{general\+\_\+spi.\+h} определяются используемые SPI.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00127}{127}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y___l_i_b_s___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}\index{SPI Tools@{SPI Tools}!SPI\_MspDeInit@{SPI\_MspDeInit}}
|
||||
\index{SPI\_MspDeInit@{SPI\_MspDeInit}!SPI Tools@{SPI Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{SPI\_MspDeInit()}{SPI\_MspDeInit()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}
|
||||
void SPI\+\_\+\+Msp\+De\+Init (\begin{DoxyParamCaption}\item[{SPI\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{hspi}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Деинициализация тактирования и прерываний SPI.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em hspi} & Указатель на хендл SPI. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых SPI, дефайнами \doxylink{group___s_p_i___i_n_i_t}{Init defines} в \doxylink{general__spi_8h}{general\+\_\+spi.\+h} определяются используемые SPI.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__spi_8c_source_l00191}{191}} of file \mbox{\hyperlink{general__spi_8c_source}{general\+\_\+spi.\+c}}.
|
||||
|
||||
\input{group___s_p_i___i_n_i_t}
|
||||
@@ -0,0 +1 @@
|
||||
99c3a53b89e12a223f1a8fa308f57ad2
|
||||
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
\doxysection{TIM Tools }
|
||||
\hypertarget{group___m_y___l_i_b_s___t_i_m}{}\label{group___m_y___l_i_b_s___t_i_m}\index{TIM Tools@{TIM Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с TIM.
|
||||
|
||||
|
||||
Collaboration diagram for TIM Tools\+:
|
||||
\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=302pt]{group___m_y___l_i_b_s___t_i_m}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}{General tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для базовой инициализации таймеров \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}{Delay tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для формирования задержек с помощью таймеров \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c}{PWM/\+OC Channels tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для инициализации базовых функций каналов таймера \end{DoxyCompactList}\item
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}{Encoder tools}}
|
||||
\begin{DoxyCompactList}\small\item\em Функции для считывания энкодера \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с TIM.
|
||||
|
||||
Модуль предоставляет универсальные инструменты для работы с TIM\+:
|
||||
\begin{DoxyItemize}
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}{General tools} — базовая инициализация таймеров и прерываний.
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}{Delay tools} — функции задержки через таймеры (blocking и non-\/blocking).
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___o_c}{PWM/\+OC Channels tools} — настройка каналов Output Compare и PWM.
|
||||
\item \doxylink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}{Encoder tools} — работа с энкодерами, чтение положения и кнопки.
|
||||
|
||||
\begin{DoxyNote}{Note}
|
||||
Требуется подключение модуля TIM в библиотеке HAL и GPIO (\doxylink{group___m_y___l_i_b_s___g_p_i_o}{GPIO Tools}) из My\+Libs
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HAL\_TIM\_MODULE\_ENABLED}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyNote}
|
||||
|
||||
\end{DoxyItemize}\input{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}
|
||||
\input{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}
|
||||
\input{group___m_y_l_i_b_s___t_i_m___o_c}
|
||||
\input{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}
|
||||
@@ -0,0 +1 @@
|
||||
78e460308ffa0a639db281cb87812b9e
|
||||
Binary file not shown.
@@ -0,0 +1,194 @@
|
||||
\doxysection{UART Tools }
|
||||
\hypertarget{group___m_y___l_i_b_s___u_a_r_t}{}\label{group___m_y___l_i_b_s___u_a_r_t}\index{UART Tools@{UART Tools}}
|
||||
|
||||
|
||||
Функции и макросы для удобной работы с UART.
|
||||
|
||||
|
||||
Collaboration diagram for UART Tools\+:
|
||||
\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=249pt]{group___m_y___l_i_b_s___u_a_r_t}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___u_a_r_t___i_n_i_t}{Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура настроек UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\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
|
||||
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}\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}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Функции и макросы для удобной работы с UART.
|
||||
|
||||
Модуль предоставляет функции для базовой инициализации UART
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Структура\ настроек\ UART}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ uart2Settings;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{keywordtype}{void}\ UART2\_Init(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ UART2\ с\ 115200\ бод,\ 8\ бит,\ 1\ стоп-\/бит,\ без\ паритета}}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Instance\ =\ USART2;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.BaudRate\ =\ 115200;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.WordLength\ =\ UART\_WORDLENGTH\_8B;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.StopBits\ =\ UART\_STOPBITS\_1;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.Parity\ =\ UART\_PARITY\_NONE;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.Mode\ =\ UART\_MODE\_TX\_RX;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.HwFlowCtl\ =\ UART\_HWCONTROL\_NONE;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_accf2c9448a3ea8eb3b8c25a569276fea}{huart}}.Init.OverSampling\ =\ UART\_OVERSAMPLING\_16;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ GPIO}}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_af6f9910d065bae715cdb4a1024143a8f}{GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a5f1babfcfb436cd77f5614253c0a5bef}{GPIO\_PIN\_TX}}\ =\ GPIO\_PIN\_2;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a3fba2b52788fe453348b5d92ed52ba49}{GPIO\_PIN\_RX}}\ =\ GPIO\_PIN\_3;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ DMA\ не\ используется\ в\ этом\ примере}}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a1ecc9ac6a1d2747ade56770cbab6a613}{DMAChannel}}\ =\ NULL;}
|
||||
\DoxyCodeLine{\ \ \ \ uart2Settings.\mbox{\hyperlink{struct_u_a_r_t___settings_type_def_a15ce92b03f7f189bfbe1ab88a5f94d19}{DMA\_CHANNEL\_X}}\ =\ 0;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Инициализация\ UART}}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y___l_i_b_s___u_a_r_t_gab9f07396b778505c934143e89953e154}{UART\_Base\_Init}}(\&uart2Settings)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\ \ \ \ \{}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{//\ Обработка\ ошибки}}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ Error\_Handler();}
|
||||
\DoxyCodeLine{\ \ \ \ \}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
\begin{DoxyNote}{Note}
|
||||
Требуется подключение модуля UART в библиотеке HAL
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HAL\_UART\_MODULE\_ENABLED}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y___l_i_b_s___u_a_r_t_doc-func-members}
|
||||
\doxysubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y___l_i_b_s___u_a_r_t_gab9f07396b778505c934143e89953e154}\index{UART Tools@{UART Tools}!UART\_Base\_Init@{UART\_Base\_Init}}
|
||||
\index{UART\_Base\_Init@{UART\_Base\_Init}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_Base\_Init()}{UART\_Base\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___u_a_r_t_gab9f07396b778505c934143e89953e154}
|
||||
HAL\+\_\+\+Status\+Type\+Def UART\+\_\+\+Base\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{suart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация UART с помощью структуры \doxylink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em suart} & Указатель на структуру с настройками UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
~\newline
|
||||
Инициализирует UART и его GPIO и при необходимости DMA. Настройка аналогична HAL\+\_\+\+UART\+\_\+\+Init
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{suart.huart.Init...}
|
||||
|
||||
\end{DoxyCode}
|
||||
но дополнительно надо прописать пины RX/\+TX \doxylink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{suart-\/>GPIOx,\ suart-\/>GPIO\_PIN\_RX,\ suart-\/>GPIO\_PIN\_TX}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00032}{32}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y___l_i_b_s___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}\index{UART Tools@{UART Tools}!UART\_Check\_Init\_Struct@{UART\_Check\_Init\_Struct}}
|
||||
\index{UART\_Check\_Init\_Struct@{UART\_Check\_Init\_Struct}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_Check\_Init\_Struct()}{UART\_Check\_Init\_Struct()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}
|
||||
HAL\+\_\+\+Status\+Type\+Def UART\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{suart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Проверка корректности структуры инициализации UART.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em suart} & Указатель на структуру с настройками UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00364}{364}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y___l_i_b_s___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}\index{UART Tools@{UART Tools}!UART\_MspInit@{UART\_MspInit}}
|
||||
\index{UART\_MspInit@{UART\_MspInit}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_MspInit()}{UART\_MspInit()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}
|
||||
void UART\+\_\+\+Msp\+Init (\begin{DoxyParamCaption}\item[{UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{huart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Настройка тактирования и прерываний UART.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em huart} & Указатель на хендл UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых UART, дефайнами \doxylink{group___u_a_r_t___i_n_i_t}{Init defines} в \doxylink{general__uart_8h}{general\+\_\+uart.\+h} определяются используемые UART.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00146}{146}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y___l_i_b_s___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}\index{UART Tools@{UART Tools}!UART\_MspDeInit@{UART\_MspDeInit}}
|
||||
\index{UART\_MspDeInit@{UART\_MspDeInit}!UART Tools@{UART Tools}}
|
||||
\doxysubsubsection{\texorpdfstring{UART\_MspDeInit()}{UART\_MspDeInit()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y___l_i_b_s___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}
|
||||
void UART\+\_\+\+Msp\+De\+Init (\begin{DoxyParamCaption}\item[{UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{huart}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Деинициализация тактирования и прерываний UART.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em huart} & Указатель на хендл UART. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с деиницилизацией неиспользуемых UART, дефайнами \doxylink{group___u_a_r_t___i_n_i_t}{Init defines} в \doxylink{general__uart_8h}{general\+\_\+uart.\+h} определяются используемые UART.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00267}{267}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||||
|
||||
\input{group___u_a_r_t___i_n_i_t}
|
||||
@@ -0,0 +1 @@
|
||||
6d655ebffedccf9f669c39d84e277d19
|
||||
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
\doxysubsection{General tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}{}\label{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}\index{General tools@{General tools}}
|
||||
|
||||
|
||||
Общие функции/макросы для работы с GPIO.
|
||||
|
||||
|
||||
Collaboration diagram for General tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=350pt]{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___g_p_i_o___i_n_i_t}{GPIO Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка состояний кнопок и количества тиков в периоде ШИМ \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\+\_\+\+Clock\+\_\+\+Enable}} (GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx)
|
||||
\begin{DoxyCompactList}\small\item\em Включить тактирование порта GPIO. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Общие функции/макросы для работы с GPIO.
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Включаем\ тактирование\ порта\ GPIOA}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(GPIOA);}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}\index{General tools@{General tools}!GPIO\_Clock\_Enable@{GPIO\_Clock\_Enable}}
|
||||
\index{GPIO\_Clock\_Enable@{GPIO\_Clock\_Enable}!General tools@{General tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_Clock\_Enable()}{GPIO\_Clock\_Enable()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+Clock\+\_\+\+Enable (\begin{DoxyParamCaption}\item[{GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}}]{GPIOx}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Включить тактирование порта GPIO.
|
||||
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00022}{22}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\input{group___g_p_i_o___i_n_i_t}
|
||||
@@ -0,0 +1 @@
|
||||
8ec911189f996d134805a169b4f102f0
|
||||
Binary file not shown.
@@ -0,0 +1,275 @@
|
||||
\doxysubsection{LED tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}{}\label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}\index{LED tools@{LED tools}}
|
||||
|
||||
|
||||
Функции для работы с GPIO, для управления светодиодом
|
||||
|
||||
|
||||
Collaboration diagram for LED tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=242pt]{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура светодиода \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Enumerations}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}{GPIO\+\_\+\+LEDState\+Type\+Def}} \{ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}{LED\+\_\+\+IS\+\_\+\+OFF}} = 0
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}{LED\+\_\+\+IS\+\_\+\+ON}} = 1
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{LED\+\_\+\+IS\+\_\+\+BLINKING}} = 2
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}{LED\+\_\+\+IS\+\_\+\+FADING}} = 3
|
||||
\}
|
||||
\begin{DoxyCompactList}\small\item\em Режимы работы светодиода \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{GPIO\+\_\+\+LED\+\_\+\+Init}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN\+\_\+X, uint8\+\_\+t LED\+\_\+\+On\+\_\+\+State)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализировать светодиод (структуру светодиода) \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\+\_\+\+LED\+\_\+\+On}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Включить светодиод \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}{GPIO\+\_\+\+LED\+\_\+\+Off}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Выключить светодиод \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}{GPIO\+\_\+\+LED\+\_\+\+Set}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint8\+\_\+t led\+\_\+state)
|
||||
\begin{DoxyCompactList}\small\item\em Выставить светодиод по переменной \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{GPIO\+\_\+\+LED\+\_\+\+Blink\+\_\+\+Start}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint32\+\_\+t period)
|
||||
\begin{DoxyCompactList}\small\item\em Активировать моргание светодиодом \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}{GPIO\+\_\+\+LED\+\_\+\+Fading\+\_\+\+Start}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led, uint32\+\_\+t period)
|
||||
\begin{DoxyCompactList}\small\item\em Активировать моргание светодиодом \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\+\_\+\+LED\+\_\+\+Dynamic\+\_\+\+Handle}} (\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}led)
|
||||
\begin{DoxyCompactList}\small\item\em Управление динамическими режимами свечения светодиода \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Функции для работы с GPIO, для управления светодиодом
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{MX\_GPIO\_Init();\ \textcolor{comment}{//\ инициализация\ пина\ аппаратная}}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Инициализация\ светодиода\ на\ порте\ GPIOA,\ пин\ 5,\ активный\ уровень\ 0}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\_LEDTypeDef}}\ led;}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}{GPIO\_LED\_Init}}(\&led,\ GPIOA,\ GPIO\_PIN\_5,\ 0);\ \textcolor{comment}{//\ или\ дефайн\ LED\_ON/LED\_OFF}}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Включение\ светодиода}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}{GPIO\_LED\_On}}(\&led);}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Запуск\ моргания}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}{GPIO\_LED\_Blink\_Start}}(\&led,\ 500);\ \textcolor{comment}{//\ Период\ 500\ мс}}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ В\ основном\ цикле}}
|
||||
\DoxyCodeLine{\textcolor{keywordflow}{while}\ (1)\ \{}
|
||||
\DoxyCodeLine{\ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\_LED\_Dynamic\_Handle}}(\&led);}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-enum-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_doc-enum-members}
|
||||
\doxysubsubsection{Enumeration Type Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}\index{LED tools@{LED tools}!GPIO\_LEDStateTypeDef@{GPIO\_LEDStateTypeDef}}
|
||||
\index{GPIO\_LEDStateTypeDef@{GPIO\_LEDStateTypeDef}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LEDStateTypeDef}{GPIO\_LEDStateTypeDef}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaac2b90d8b8c9579b6aa5d3bbda9b1ff1}{GPIO\+\_\+\+LEDState\+Type\+Def}}}
|
||||
|
||||
|
||||
|
||||
Режимы работы светодиода
|
||||
|
||||
\begin{DoxyEnumFields}[2]{Enumerator}
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{LED\_IS\_OFF@{LED\_IS\_OFF}!LED tools@{LED tools}}\index{LED tools@{LED tools}!LED\_IS\_OFF@{LED\_IS\_OFF}}}\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}\label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a74276cd2464314e422e8a144483f74ae}
|
||||
LED\+\_\+\+IS\+\_\+\+OFF&Светодиод выключен \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{LED\_IS\_ON@{LED\_IS\_ON}!LED tools@{LED tools}}\index{LED tools@{LED tools}!LED\_IS\_ON@{LED\_IS\_ON}}}\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}\label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1af6abfb9c5b95abbdb239590f2cd245ea}
|
||||
LED\+\_\+\+IS\+\_\+\+ON&Светодиод включен \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{LED\_IS\_BLINKING@{LED\_IS\_BLINKING}!LED tools@{LED tools}}\index{LED tools@{LED tools}!LED\_IS\_BLINKING@{LED\_IS\_BLINKING}}}\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}\label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}
|
||||
LED\+\_\+\+IS\+\_\+\+BLINKING&Моргание светодиодом \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{LED\_IS\_FADING@{LED\_IS\_FADING}!LED tools@{LED tools}}\index{LED tools@{LED tools}!LED\_IS\_FADING@{LED\_IS\_FADING}}}\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}\label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1aa610f6df44c939aa7d45e318036fa03b}
|
||||
LED\+\_\+\+IS\+\_\+\+FADING&Плавное моргание светодиодом \\
|
||||
\hline
|
||||
|
||||
\end{DoxyEnumFields}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8h_source_l00062}{62}} of file \mbox{\hyperlink{general__gpio_8h_source}{general\+\_\+gpio.\+h}}.
|
||||
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}\index{LED tools@{LED tools}!GPIO\_LED\_Init@{GPIO\_LED\_Init}}
|
||||
\index{GPIO\_LED\_Init@{GPIO\_LED\_Init}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_Init()}{GPIO\_LED\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gac936453c7a0841c0b17bcfdae4958084}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+LED\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{, }\item[{GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}}]{GPIOx}{, }\item[{uint32\+\_\+t}]{GPIO\+\_\+\+PIN\+\_\+X}{, }\item[{uint8\+\_\+t}]{LED\+\_\+\+Active\+Level}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализировать светодиод (структуру светодиода)
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em led} & Указатель на структуру светодиода \\
|
||||
\hline
|
||||
{\em GPIOx} & Указатель на структуру порта для светодиода \\
|
||||
\hline
|
||||
{\em GPIO\+\_\+\+PIN\+\_\+X} & Пин для светодиода \\
|
||||
\hline
|
||||
{\em LED\+\_\+\+Active\+Level} & Состояния пина, при котором светодиод будет включен \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00073}{73}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}\index{LED tools@{LED tools}!GPIO\_LED\_On@{GPIO\_LED\_On}}
|
||||
\index{GPIO\_LED\_On@{GPIO\_LED\_On}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_On()}{GPIO\_LED\_On()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ga4b9572949326b050694cd55d0a7e5f6c}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+LED\+\_\+\+On (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Включить светодиод
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em led} & Указатель на структуру светодиода \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL Status
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00091}{91}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}\index{LED tools@{LED tools}!GPIO\_LED\_Off@{GPIO\_LED\_Off}}
|
||||
\index{GPIO\_LED\_Off@{GPIO\_LED\_Off}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_Off()}{GPIO\_LED\_Off()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaadda2d4f021390a4e392210a5ace5357}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+LED\+\_\+\+Off (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Выключить светодиод
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em led} & Указатель на структуру светодиода \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL Status
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00107}{107}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}\index{LED tools@{LED tools}!GPIO\_LED\_Set@{GPIO\_LED\_Set}}
|
||||
\index{GPIO\_LED\_Set@{GPIO\_LED\_Set}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_Set()}{GPIO\_LED\_Set()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gae78b570447d55a462a679a89dbaa8ea2}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+LED\+\_\+\+Set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{, }\item[{uint8\+\_\+t}]{led\+\_\+state}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Выставить светодиод по переменной
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em led} & Указатель на структуру светодиода \\
|
||||
\hline
|
||||
{\em led\+\_\+state} & Состояние светодиода \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL Status
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00125}{125}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}\index{LED tools@{LED tools}!GPIO\_LED\_Blink\_Start@{GPIO\_LED\_Blink\_Start}}
|
||||
\index{GPIO\_LED\_Blink\_Start@{GPIO\_LED\_Blink\_Start}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_Blink\_Start()}{GPIO\_LED\_Blink\_Start()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaf22f44ecaf6a1932b47edc5a845b03a9}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+LED\+\_\+\+Blink\+\_\+\+Start (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{, }\item[{uint32\+\_\+t}]{period}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Активировать моргание светодиодом
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em led} & Указатель на структуру светодиода \\
|
||||
\hline
|
||||
{\em period} & Период плавного моргания светодиода \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL Status
|
||||
\end{DoxyReturn}
|
||||
Функция ставит режим моргания, который после управляется в \doxylink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\+\_\+\+LED\+\_\+\+Dynamic\+\_\+\+Handle}
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00146}{146}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}\index{LED tools@{LED tools}!GPIO\_LED\_Fading\_Start@{GPIO\_LED\_Fading\_Start}}
|
||||
\index{GPIO\_LED\_Fading\_Start@{GPIO\_LED\_Fading\_Start}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_Fading\_Start()}{GPIO\_LED\_Fading\_Start()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gaa00f20021781464af3dfe74aa3e59a0a}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+LED\+\_\+\+Fading\+\_\+\+Start (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{, }\item[{uint32\+\_\+t}]{period}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Активировать моргание светодиодом
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em led} & Указатель на структуру светодиода \\
|
||||
\hline
|
||||
{\em period} & Период плавного моргания светодиода \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL Status
|
||||
\end{DoxyReturn}
|
||||
Функция ставит режим моргания, который после управляется в \doxylink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}{GPIO\+\_\+\+LED\+\_\+\+Dynamic\+\_\+\+Handle}
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00164}{164}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}\index{LED tools@{LED tools}!GPIO\_LED\_Dynamic\_Handle@{GPIO\_LED\_Dynamic\_Handle}}
|
||||
\index{GPIO\_LED\_Dynamic\_Handle@{GPIO\_LED\_Dynamic\_Handle}!LED tools@{LED tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_LED\_Dynamic\_Handle()}{GPIO\_LED\_Dynamic\_Handle()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_gad6e6189824406c4d472b6340c7f19bb2}
|
||||
void GPIO\+\_\+\+LED\+\_\+\+Dynamic\+\_\+\+Handle (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def}{GPIO\+\_\+\+LEDType\+Def}} \texorpdfstring{$\ast$}{*}}]{led}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Управление динамическими режимами свечения светодиода
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em Указатель} & на структуру светодиода\\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
Функция моргает/плавно моргает светодиодом в неблокирующем режиме Т.\+е. функцию надо вызывать постоянно, чтобы она мониторила тики и в нужный момент переключала светодиод
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00184}{184}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3bf4f566822869d8ecbfc78ce5e2a6c7
|
||||
Binary file not shown.
@@ -0,0 +1,110 @@
|
||||
\doxysubsection{Switch tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}{}\label{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}\index{Switch tools@{Switch tools}}
|
||||
|
||||
|
||||
Функции для работы с GPIO, как с кнопкой
|
||||
|
||||
|
||||
Collaboration diagram for Switch tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=252pt]{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура кнопки \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\+\_\+\+Switch\+\_\+\+Init}} (\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}sw, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t GPIO\+\_\+\+PIN\+\_\+X, uint8\+\_\+t SW\+\_\+\+On\+\_\+\+State)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализировать кнопку (структуру кнопки) \end{DoxyCompactList}\item
|
||||
int \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\+\_\+\+Read\+\_\+\+Switch}} (\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}swstart)
|
||||
\begin{DoxyCompactList}\small\item\em Считать состоянии кнопки \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Функции для работы с GPIO, как с кнопкой
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{MX\_GPIO\_Init();\ \textcolor{comment}{//\ инициализация\ пина\ аппаратная}}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Инициализация\ кнопки\ на\ порте\ GPIOB,\ пин\ 0,\ активный\ уровень\ 1}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\_SwitchTypeDef}}\ sw1;}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\_Switch\_Init}}(\&sw1,\ GPIOB,\ GPIO\_PIN\_0,\ 1);\ \textcolor{comment}{//\ или\ дефайн\ SW\_ON/SW\_OFF}}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ Считываем\ состояние\ кнопки}}
|
||||
\DoxyCodeLine{\textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\_Read\_Switch}}(\&sw1))}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Кнопка\ нажата}}
|
||||
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}{LED\_ON}}();}
|
||||
\DoxyCodeLine{\}}
|
||||
\DoxyCodeLine{\textcolor{keywordflow}{else}}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Кнопка\ отжата}}
|
||||
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}{LED\_OFF}}();}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}\index{Switch tools@{Switch tools}!GPIO\_Switch\_Init@{GPIO\_Switch\_Init}}
|
||||
\index{GPIO\_Switch\_Init@{GPIO\_Switch\_Init}!Switch tools@{Switch tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_Switch\_Init()}{GPIO\_Switch\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}
|
||||
HAL\+\_\+\+Status\+Type\+Def GPIO\+\_\+\+Switch\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sw}{, }\item[{GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}}]{GPIOx}{, }\item[{uint32\+\_\+t}]{GPIO\+\_\+\+PIN\+\_\+X}{, }\item[{uint8\+\_\+t}]{SW\+\_\+\+Active\+Level}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализировать кнопку (структуру кнопки)
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sw} & Указатель на структуру кнопки \\
|
||||
\hline
|
||||
{\em GPIOx} & Указатель на структуру порта для кнопки \\
|
||||
\hline
|
||||
{\em GPIO\+\_\+\+PIN\+\_\+X} & Пин для кнопки \\
|
||||
\hline
|
||||
{\em SW\+\_\+\+Active\+Level} & Состояния пина, когда кнопка нажата \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL Status
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00258}{258}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}\index{Switch tools@{Switch tools}!GPIO\_Read\_Switch@{GPIO\_Read\_Switch}}
|
||||
\index{GPIO\_Read\_Switch@{GPIO\_Read\_Switch}!Switch tools@{Switch tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{GPIO\_Read\_Switch()}{GPIO\_Read\_Switch()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}
|
||||
int GPIO\+\_\+\+Read\+\_\+\+Switch (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_g_p_i_o___switch_type_def}{GPIO\+\_\+\+Switch\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{sw}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Считать состоянии кнопки
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em sw} & Указатель на структуру кнопки \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
1 -\/ если кнопка нажата, 0 -\/ если отжата, -\/1 -\/ если ошибка
|
||||
\end{DoxyReturn}
|
||||
Функция включает в себя неблокирующую проверку на дребезг Т.\+е. функцию надо вызывать постоянно, чтобы она мониторила состояние кнопки
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__gpio_8c_source_l00278}{278}} of file \mbox{\hyperlink{general__gpio_8c_source}{general\+\_\+gpio.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
c32ffdb29126accc04d6d77ce5604377
|
||||
Binary file not shown.
@@ -0,0 +1,130 @@
|
||||
\doxysubsection{Delay tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}{}\label{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}\index{Delay tools@{Delay tools}}
|
||||
|
||||
|
||||
Функции для формирования задержек с помощью таймеров
|
||||
|
||||
|
||||
Collaboration diagram for Delay tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=240pt]{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\+\_\+\+Delay\+\_\+\+Start}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Начать отсчет неблокирующей задержки. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\+\_\+\+Delay}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint16\+\_\+t delay)
|
||||
\begin{DoxyCompactList}\small\item\em Задержка в тиках таймера (блокирующая). \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\+\_\+\+Delay\+\_\+\+Non\+Blocking}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint16\+\_\+t delay)
|
||||
\begin{DoxyCompactList}\small\item\em Задержка в тиках таймера (неблокирующая). \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Функции для формирования задержек с помощью таймеров
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{TIM\_HandleTypeDef\ htim2;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ блокирующая\ задержка\ 500\ тиков\ таймера}}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_gaf2e697ac60e05813d45ea2c9c9e79c25}{LED\_ON}}();}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\_Delay}}(\&htim2,\ 500);}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga80700bb63bd56ebabbb4728aa433fd29}{LED\_OFF}}();}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{keywordflow}{while}(1)}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \textcolor{comment}{//\ не\ блокирующая\ задержка\ 200\ тиков\ таймера}}
|
||||
\DoxyCodeLine{\ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\_Delay\_NonBlocking}}(\&htim2,\ 200)\ ==\ HAL\_OK)}
|
||||
\DoxyCodeLine{\ \ \{}
|
||||
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\_Delay\_Start}}(\&htim2);}
|
||||
\DoxyCodeLine{\ \ \ \ LED\_TOOGLE();}
|
||||
\DoxyCodeLine{\ \ \}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}\index{Delay tools@{Delay tools}!TIM\_Delay\_Start@{TIM\_Delay\_Start}}
|
||||
\index{TIM\_Delay\_Start@{TIM\_Delay\_Start}!Delay tools@{Delay tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Delay\_Start()}{TIM\_Delay\_Start()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Delay\+\_\+\+Start (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Начать отсчет неблокирующей задержки.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
Сбрасывает счетчик для начала отсчета неблокирующей задержки. \doxylink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\+\_\+\+Delay\+\_\+\+Non\+Blocking} для проверки статуса задержки
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00363}{363}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}\index{Delay tools@{Delay tools}!TIM\_Delay@{TIM\_Delay}}
|
||||
\index{TIM\_Delay@{TIM\_Delay}!Delay tools@{Delay tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Delay()}{TIM\_Delay()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Delay (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{, }\item[{uint16\+\_\+t}]{delay}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Задержка в тиках таймера (блокирующая).
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
{\em delay} & Задержка в тиках таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
Формирует задержку с блокировкой программы.
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00337}{337}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}\index{Delay tools@{Delay tools}!TIM\_Delay\_NonBlocking@{TIM\_Delay\_NonBlocking}}
|
||||
\index{TIM\_Delay\_NonBlocking@{TIM\_Delay\_NonBlocking}!Delay tools@{Delay tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Delay\_NonBlocking()}{TIM\_Delay\_NonBlocking()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Delay\+\_\+\+Non\+Blocking (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{, }\item[{uint16\+\_\+t}]{delay}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Задержка в тиках таймера (неблокирующая).
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
{\em delay} & Задержка в тиках таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
Формирует задержку с блокировкой программы. Перед ожиданием задержки надо запутстить таймер \doxylink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\+\_\+\+Delay\+\_\+\+Start} \begin{DoxyNote}{Note}
|
||||
Таймер не должен использоваться на время этой задержки
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00382}{382}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3cedaa6aa3bafcfce93e4c68298d1181
|
||||
Binary file not shown.
@@ -0,0 +1,133 @@
|
||||
\doxysubsection{Encoder tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}{}\label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}\index{Encoder tools@{Encoder tools}}
|
||||
|
||||
|
||||
Функции для считывания энкодера
|
||||
|
||||
|
||||
Collaboration diagram for Encoder tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=251pt]{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура инициализации енкодера \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\+\_\+\+Encoder\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc1, TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация режима энкодер у таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\+\_\+\+Encoder\+\_\+\+Read}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
|
||||
\begin{DoxyCompactList}\small\item\em Считать энкодер. \end{DoxyCompactList}\item
|
||||
int \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\+\_\+\+Encoder\+\_\+\+Read\+Switch}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
|
||||
\begin{DoxyCompactList}\small\item\em Считать кнопку энкодера. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Функции для считывания энкодера
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ henc1;}
|
||||
\DoxyCodeLine{TIM\_HandleTypeDef\ htim4;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ инициализация}}
|
||||
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}\ =\ \&htim4;}
|
||||
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}}\ =\ GPIOA;}
|
||||
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}}\ =\ GPIO\_PIN\_0;}
|
||||
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}}\ =\ GPIO\_PIN\_1;}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\_Encoder\_Init}}(\&henc1,\ \&htim4);}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{comment}{//\ считывание\ энкодера\ и\ кнопки}}
|
||||
\DoxyCodeLine{int16\_t\ delta\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\_Encoder\_Read}}(\&henc1);}
|
||||
\DoxyCodeLine{setpoint\_tmp\ +=\ delta;}
|
||||
\DoxyCodeLine{\textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\_Encoder\_ReadSwitch}}(\&henc1))}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ setpoint\ =\ setpoint\_tmp;\ \textcolor{comment}{//\ подтвердить\ новое\ значение}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}\index{Encoder tools@{Encoder tools}!TIM\_Encoder\_Init@{TIM\_Encoder\_Init}}
|
||||
\index{TIM\_Encoder\_Init@{TIM\_Encoder\_Init}!Encoder tools@{Encoder tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Encoder\_Init()}{TIM\_Encoder\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Encoder\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{henc}{, }\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация режима энкодер у таймера.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em henc} & Указатель на хендл энкодера. \\
|
||||
\hline
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
\begin{DoxyNote}{Note}
|
||||
Предварительно надо инициализировать таймер \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00168}{168}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}\index{Encoder tools@{Encoder tools}!TIM\_Encoder\_Read@{TIM\_Encoder\_Read}}
|
||||
\index{TIM\_Encoder\_Read@{TIM\_Encoder\_Read}!Encoder tools@{Encoder tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Encoder\_Read()}{TIM\_Encoder\_Read()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Encoder\+\_\+\+Read (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{henc}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Считать энкодер.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em henc} & Указатель на хендл энкодера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
Читает разницу энкодера, которую он накопил после предыдущего вызова этой функции.
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00303}{303}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}\index{Encoder tools@{Encoder tools}!TIM\_Encoder\_ReadSwitch@{TIM\_Encoder\_ReadSwitch}}
|
||||
\index{TIM\_Encoder\_ReadSwitch@{TIM\_Encoder\_ReadSwitch}!Encoder tools@{Encoder tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Encoder\_ReadSwitch()}{TIM\_Encoder\_ReadSwitch()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}
|
||||
int TIM\+\_\+\+Encoder\+\_\+\+Read\+Switch (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{henc}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Считать кнопку энкодера.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em henc} & Указатель на хендл энкодера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
1 -\/ если кнопка нажата, 0 -\/ если отжата, -\/1 -\/ если ошибка
|
||||
\end{DoxyReturn}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00322}{322}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
14186dd9246ecfbe0eb10fb07d8e0d39
|
||||
Binary file not shown.
@@ -0,0 +1,237 @@
|
||||
\doxysubsection{General tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}{}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}\index{General tools@{General tools}}
|
||||
|
||||
|
||||
Функции для базовой инициализации таймеров
|
||||
|
||||
|
||||
Collaboration diagram for General tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=350pt]{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Topics}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\mbox{\hyperlink{group___t_i_m___i_n_i_t}{TIM Init defines}}
|
||||
\begin{DoxyCompactList}\small\item\em Настройка таймеров \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Classes}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
struct \mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}}
|
||||
\begin{DoxyCompactList}\small\item\em Структура инициализации таймера \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Enumerations}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}} \{ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8}{TIM\+\_\+\+DEFAULT}} = 0
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}{TIM\+\_\+\+IT\+\_\+\+MODE}} = TIM\+\_\+\+IT\+\_\+\+CONF
|
||||
\}
|
||||
\begin{DoxyCompactList}\small\item\em Режим прерываний таймера \end{DoxyCompactList}\item
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{TIM\+\_\+\+MHz\+Tick\+Base\+Type\+Def}} \{ \newline
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5}{TIM\+\_\+\+Base\+\_\+\+Disable}} = 0
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2}{TIM\+\_\+\+Tick\+Base\+\_\+1\+US}} = 1
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}{TIM\+\_\+\+Tick\+Base\+\_\+10\+US}} = 10
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30}{TIM\+\_\+\+Tick\+Base\+\_\+100\+US}} = 100
|
||||
, \newline
|
||||
\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25}{TIM\+\_\+\+Tick\+Base\+\_\+1\+MS}} = 1000
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa}{TIM\+\_\+\+Tick\+Base\+\_\+10\+MS}} = 10000
|
||||
, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da}{TIM\+\_\+\+Tick\+Base\+\_\+100\+MS}} = 100000
|
||||
\}
|
||||
\begin{DoxyCompactList}\small\item\em Длительность тика таймера (частота тактирования таймера) \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}stim)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация таймера. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\+\_\+\+Base\+\_\+\+Msp\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}} it\+\_\+mode)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация CLK и NVIC таймеров. \end{DoxyCompactList}\item
|
||||
void \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{TIM\+\_\+\+Base\+\_\+\+Msp\+De\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
|
||||
\begin{DoxyCompactList}\small\item\em Деинициализация CLK и NVIC таймеров. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Функции для базовой инициализации таймеров
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}}\ tim2Settings;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\textcolor{keywordtype}{void}\ TIM2\_Init(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ таймера\ TIM2\ на\ 1\ кГц\ с\ прерываниями\ с\ шагом\ таймера\ 10\ мкс}}
|
||||
\DoxyCodeLine{\ \ \ \ tim2Settings.\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance\ =\ TIM2;}
|
||||
\DoxyCodeLine{\ \ \ \ tim2Settings.\mbox{\hyperlink{struct_t_i_m___settings_type_def_ab90e370c3edda88e76583293c250d2b0}{sTimMode}}\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}{TIM\_IT\_MODE}};}
|
||||
\DoxyCodeLine{\ \ \ \ tim2Settings.\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}{TIM\_TickBase\_10US}};}
|
||||
\DoxyCodeLine{\ \ \ \ tim2Settings.\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ =\ 1;}
|
||||
\DoxyCodeLine{\ \ \ \ tim2Settings.\mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{sTimFreqHz}}\ =\ 1000;\ \textcolor{comment}{//\ 1\ кГц}}
|
||||
\DoxyCodeLine{\ \ \ \ tim2Settings.\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}\ =\ 72000000;\ \textcolor{comment}{//\ Hz}}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\_Base\_Init}}(\&tim2Settings)\ !=\ HAL\_OK)}
|
||||
\DoxyCodeLine{\ \ \ \ \{}
|
||||
\DoxyCodeLine{\ \ \ \ \ \ \ \ Error\_Handler();}
|
||||
\DoxyCodeLine{\ \ \ \ \}}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-enum-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_doc-enum-members}
|
||||
\doxysubsubsection{Enumeration Type Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}\index{General tools@{General tools}!TIM\_ITModeTypeDef@{TIM\_ITModeTypeDef}}
|
||||
\index{TIM\_ITModeTypeDef@{TIM\_ITModeTypeDef}!General tools@{General tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_ITModeTypeDef}{TIM\_ITModeTypeDef}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}}}
|
||||
|
||||
|
||||
|
||||
Режим прерываний таймера
|
||||
|
||||
\begin{DoxyEnumFields}[2]{Enumerator}
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_DEFAULT@{TIM\_DEFAULT}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_DEFAULT@{TIM\_DEFAULT}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8}
|
||||
TIM\+\_\+\+DEFAULT&Прерываний отключены \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_IT\_MODE@{TIM\_IT\_MODE}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_IT\_MODE@{TIM\_IT\_MODE}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c}
|
||||
TIM\+\_\+\+IT\+\_\+\+MODE&Прерываний включены \\
|
||||
\hline
|
||||
|
||||
\end{DoxyEnumFields}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8h_source_l00078}{78}} of file \mbox{\hyperlink{general__tim_8h_source}{general\+\_\+tim.\+h}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}\index{General tools@{General tools}!TIM\_MHzTickBaseTypeDef@{TIM\_MHzTickBaseTypeDef}}
|
||||
\index{TIM\_MHzTickBaseTypeDef@{TIM\_MHzTickBaseTypeDef}!General tools@{General tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_MHzTickBaseTypeDef}{TIM\_MHzTickBaseTypeDef}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}
|
||||
enum \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{TIM\+\_\+\+MHz\+Tick\+Base\+Type\+Def}}}
|
||||
|
||||
|
||||
|
||||
Длительность тика таймера (частота тактирования таймера)
|
||||
|
||||
enum дает базовые длительности, но можно выставить другие (напр 500 -\/ 0.\+5 мс) \begin{DoxyEnumFields}[2]{Enumerator}
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_Base\_Disable@{TIM\_Base\_Disable}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_Base\_Disable@{TIM\_Base\_Disable}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5}
|
||||
TIM\+\_\+\+Base\+\_\+\+Disable&Таймер отключен \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_TickBase\_1US@{TIM\_TickBase\_1US}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_TickBase\_1US@{TIM\_TickBase\_1US}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2}
|
||||
TIM\+\_\+\+Tick\+Base\+\_\+1\+US&Таймер тактируется с частотой 1 МГц \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_TickBase\_10US@{TIM\_TickBase\_10US}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_TickBase\_10US@{TIM\_TickBase\_10US}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f}
|
||||
TIM\+\_\+\+Tick\+Base\+\_\+10\+US&Таймер тактируется с частотой 100 кГц \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_TickBase\_100US@{TIM\_TickBase\_100US}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_TickBase\_100US@{TIM\_TickBase\_100US}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30}
|
||||
TIM\+\_\+\+Tick\+Base\+\_\+100\+US&Таймер тактируется с частотой 10 кГц \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_TickBase\_1MS@{TIM\_TickBase\_1MS}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_TickBase\_1MS@{TIM\_TickBase\_1MS}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25}
|
||||
TIM\+\_\+\+Tick\+Base\+\_\+1\+MS&Таймер тактируется с частотой 1 кГц \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_TickBase\_10MS@{TIM\_TickBase\_10MS}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_TickBase\_10MS@{TIM\_TickBase\_10MS}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa}
|
||||
TIM\+\_\+\+Tick\+Base\+\_\+10\+MS&Таймер тактируется с частотой 100 Гц \\
|
||||
\hline
|
||||
|
||||
\raisebox{\heightof{T}}[0pt][0pt]{\index{TIM\_TickBase\_100MS@{TIM\_TickBase\_100MS}!General tools@{General tools}}\index{General tools@{General tools}!TIM\_TickBase\_100MS@{TIM\_TickBase\_100MS}}}\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da}\label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da}
|
||||
TIM\+\_\+\+Tick\+Base\+\_\+100\+MS&Таймер тактируется с частотой 10 Гц \\
|
||||
\hline
|
||||
|
||||
\end{DoxyEnumFields}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8h_source_l00092}{92}} of file \mbox{\hyperlink{general__tim_8h_source}{general\+\_\+tim.\+h}}.
|
||||
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}\index{General tools@{General tools}!TIM\_Base\_Init@{TIM\_Base\_Init}}
|
||||
\index{TIM\_Base\_Init@{TIM\_Base\_Init}!General tools@{General tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Base\_Init()}{TIM\_Base\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Base\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{stim}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация таймера.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em stim} & Указатель на структуру с настройками таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
~\newline
|
||||
Инициализирует таймер исходя из настроек верхнего уровня\+:
|
||||
\begin{DoxyItemize}
|
||||
\item Длительность одного тика \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaa0a51c870325217ac099881f09dd0800}{TIM\+\_\+\+MHz\+Tick\+Base\+Type\+Def}
|
||||
\item Частота таймера (в Гц, float)
|
||||
\item Частота тактирования таймера от шины (в Гц, float)
|
||||
\end{DoxyItemize}
|
||||
|
||||
При невозможности выставления частоты при заданой длительности тика длительность тика увеличивается до тех пор, пока частота не будет достигнута.
|
||||
|
||||
При выставлении дефайна UPDATE\+\_\+\+TIM\+\_\+\+PARAMS\+\_\+\+AFTER\+\_\+\+INITIALIZATION новая длительность тика записывается в структуру.
|
||||
|
||||
Также остается возможность низкоуровневой настройки по структурам \doxylink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}. Для этого надо высокоуровневые настройки приравнять к нулю
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00034}{34}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}\index{General tools@{General tools}!TIM\_Base\_MspInit@{TIM\_Base\_MspInit}}
|
||||
\index{TIM\_Base\_MspInit@{TIM\_Base\_MspInit}!General tools@{General tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Base\_MspInit()}{TIM\_Base\_MspInit()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}
|
||||
void TIM\+\_\+\+Base\+\_\+\+Msp\+Init (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{, }\item[{\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\+\_\+\+ITMode\+Type\+Def}}}]{it\+\_\+mode}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация CLK и NVIC таймеров.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с иницилизацией неиспользуемых таймеров, дефайнами \doxylink{group___t_i_m___i_n_i_t}{TIM Init defines} в \doxylink{general__tim_8h}{general\+\_\+tim.\+h} определяются используемые таймеры.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00408}{408}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}\index{General tools@{General tools}!TIM\_Base\_MspDeInit@{TIM\_Base\_MspDeInit}}
|
||||
\index{TIM\_Base\_MspDeInit@{TIM\_Base\_MspDeInit}!General tools@{General tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Base\_MspDeInit()}{TIM\_Base\_MspDeInit()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}
|
||||
void TIM\+\_\+\+Base\+\_\+\+Msp\+De\+Init (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Деинициализация CLK и NVIC таймеров.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyNote}{Note}
|
||||
Чтобы не генерировать функцию с деиницилизацией неиспользуемых таймеров, дефайнами \doxylink{group___t_i_m___i_n_i_t}{TIM Init defines} в \doxylink{general__tim_8h}{general\+\_\+tim.\+h} определяются используемые таймеры.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00617}{617}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\input{group___t_i_m___i_n_i_t}
|
||||
@@ -0,0 +1 @@
|
||||
92615923be47ef42be1207dcafd66889
|
||||
Binary file not shown.
@@ -0,0 +1,111 @@
|
||||
\doxysubsection{PWM/\+OC Channels tools }
|
||||
\hypertarget{group___m_y_l_i_b_s___t_i_m___o_c}{}\label{group___m_y_l_i_b_s___t_i_m___o_c}\index{PWM/OC Channels tools@{PWM/OC Channels tools}}
|
||||
|
||||
|
||||
Функции для инициализации базовых функций каналов таймера
|
||||
|
||||
|
||||
Collaboration diagram for PWM/\+OC Channels tools\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=302pt]{group___m_y_l_i_b_s___t_i_m___o_c}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsubsection*{Functions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\+\_\+\+Output\+\_\+\+PWM\+\_\+\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, TIM\+\_\+\+OC\+\_\+\+Init\+Type\+Def \texorpdfstring{$\ast$}{*}s\+Config\+OC, uint32\+\_\+t TIM\+\_\+\+CHANNEL, GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint32\+\_\+t PWM\+\_\+\+PIN)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация выхода ШИМ таймера. \end{DoxyCompactList}\item
|
||||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\+\_\+\+OC\+\_\+\+Comparator\+\_\+\+Init}} (TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint32\+\_\+t TIM\+\_\+\+CHANNEL)
|
||||
\begin{DoxyCompactList}\small\item\em Инициализация OC компаратора таймера. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsubsection{Detailed Description}
|
||||
Функции для инициализации базовых функций каналов таймера
|
||||
|
||||
\begin{DoxyParagraph}{Пример использования\+:}
|
||||
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{\textcolor{keywordtype}{void}\ PWM\_Channel\_Init\_Example(\textcolor{keywordtype}{void})}
|
||||
\DoxyCodeLine{\{}
|
||||
\DoxyCodeLine{\ \ \ \ TIM\_HandleTypeDef\ htim3;}
|
||||
\DoxyCodeLine{\ \ \ \ TIM\_OC\_InitTypeDef\ sConfigOC;}
|
||||
\DoxyCodeLine{\ \ \ \ GPIO\_TypeDef\ *GPIOx\ =\ GPIOB;}
|
||||
\DoxyCodeLine{\ \ \ \ uint32\_t\ PWM\_PIN\ =\ GPIO\_PIN\_0;}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ таймера\ и\ канала\ PWM}}
|
||||
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\_Output\_PWM\_Init}}(\&htim3,\ \&sConfigOC,\ TIM\_CHANNEL\_1,\ GPIOx,\ PWM\_PIN);}
|
||||
\DoxyCodeLine{}
|
||||
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ Настройка\ компаратора\ OC}}
|
||||
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\_OC\_Comparator\_Init}}(\&htim3,\ TIM\_CHANNEL\_1);}
|
||||
\DoxyCodeLine{\}}
|
||||
|
||||
\end{DoxyCode}
|
||||
|
||||
\end{DoxyParagraph}
|
||||
|
||||
|
||||
\label{doc-func-members}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___o_c_doc-func-members}
|
||||
\doxysubsubsection{Function Documentation}
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}\index{PWM/OC Channels tools@{PWM/OC Channels tools}!TIM\_Output\_PWM\_Init@{TIM\_Output\_PWM\_Init}}
|
||||
\index{TIM\_Output\_PWM\_Init@{TIM\_Output\_PWM\_Init}!PWM/OC Channels tools@{PWM/OC Channels tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_Output\_PWM\_Init()}{TIM\_Output\_PWM\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Output\+\_\+\+PWM\+\_\+\+Init (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{, }\item[{TIM\+\_\+\+OC\+\_\+\+Init\+Type\+Def \texorpdfstring{$\ast$}{*}}]{s\+Config\+OC}{, }\item[{uint32\+\_\+t}]{TIM\+\_\+\+CHANNEL}{, }\item[{GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}}]{GPIOx}{, }\item[{uint32\+\_\+t}]{GPIO\+\_\+\+PIN}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация выхода ШИМ таймера.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
{\em s\+Config\+OC} & Указатель на настрйоки канала таймера. \\
|
||||
\hline
|
||||
{\em TIM\+\_\+\+CHANNEL} & Канал таймера для настройки. \\
|
||||
\hline
|
||||
{\em GPIOx} & Порт для вывода ШИМ. \\
|
||||
\hline
|
||||
{\em GPIO\+\_\+\+PIN} & Пин для вывода ШИМ. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
\begin{DoxyNote}{Note}
|
||||
Предварительно надо инициализировать таймер \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00226}{226}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
\Hypertarget{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}\index{PWM/OC Channels tools@{PWM/OC Channels tools}!TIM\_OC\_Comparator\_Init@{TIM\_OC\_Comparator\_Init}}
|
||||
\index{TIM\_OC\_Comparator\_Init@{TIM\_OC\_Comparator\_Init}!PWM/OC Channels tools@{PWM/OC Channels tools}}
|
||||
\doxysubsubsubsection{\texorpdfstring{TIM\_OC\_Comparator\_Init()}{TIM\_OC\_Comparator\_Init()}}
|
||||
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}
|
||||
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+OC\+\_\+\+Comparator\+\_\+\+Init (\begin{DoxyParamCaption}\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{, }\item[{uint32\+\_\+t}]{TIM\+\_\+\+CHANNEL}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Инициализация OC компаратора таймера.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Parameters}
|
||||
{\em htim} & Указатель на хендл таймера. \\
|
||||
\hline
|
||||
{\em TIM\+\_\+\+CHANNEL} & Канал таймера для настройки. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Returns}
|
||||
HAL status.
|
||||
\end{DoxyReturn}
|
||||
\begin{DoxyNote}{Note}
|
||||
Предварительно надо инициализировать таймер \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}.
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
Definition at line \mbox{\hyperlink{general__tim_8c_source_l00272}{272}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2d97b43bcacae6bffac0b08d422abcf0
|
||||
BIN
AllLibs/PeriphGeneral/Doc/latex/group___s_p_i___i_n_i_t.pdf
Normal file
BIN
AllLibs/PeriphGeneral/Doc/latex/group___s_p_i___i_n_i_t.pdf
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user