- MyLibs - максимально платформонезависимые библиотеки (кроме разве что RTT) - RTT - STM32_General - библиотеки для периферии stm32
		
			
				
	
	
		
			177 lines
		
	
	
		
			25 KiB
		
	
	
	
		
			TeX
		
	
	
	
	
	
			
		
		
	
	
			177 lines
		
	
	
		
			25 KiB
		
	
	
	
		
			TeX
		
	
	
	
	
	
\doxysection{general\+\_\+spi.\+h}
 | 
						||
\hypertarget{general__spi_8h_source}{}\label{general__spi_8h_source}\index{E:/.WORK/STM32/STM32\_ExtendedLibs/STM32\_General/Inc/general\_spi.h@{E:/.WORK/STM32/STM32\_ExtendedLibs/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\ MY\_LIBS\_SPI\ \ \ \ \ \ SPI\ Tools}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00007}00007\ \textcolor{comment}{*\ @ingroup\ \ MYLIBS\_PERIPHERAL}}
 | 
						||
\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\ Init\ defines}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00071}00071\ \textcolor{comment}{\ \ *\ @ingroup\ \ \ \ MY\_LIBS\_SPI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00072}00072\ \textcolor{comment}{\ \ *\ @brief\ \ \ \ \ \ Настройка\ SPI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00073}00073\ \textcolor{comment}{\ \ *\ @\{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00074}00074\ \textcolor{comment}{\ \ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00075}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga8ad4712bf4add56892d057778e826e0c}{00075}}\ \textcolor{preprocessor}{\#define\ HAL\_SPI\_MODULE\_ENABLED\ \ \ }\textcolor{comment}{///<\ Включение\ HAL\ SPI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00076}00076\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00077}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga2fe0c8aeb2c61679f32836fef479eedf}{00077}}\ \textcolor{preprocessor}{\#define\ USE\_SPI1\ \ \ \ }\textcolor{comment}{///<\ Включить\ SPI1\ в\ @ref\ SPI\_MspInit}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00078}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga53687cddb8e39e76a79b8ffaa152fb2b}{00078}}\ \textcolor{preprocessor}{\#define\ USE\_SPI2\ \ \ \ }\textcolor{comment}{///<\ Включить\ SPI2\ в\ @ref\ SPI\_MspInit}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00079}\mbox{\hyperlink{group___s_p_i___i_n_i_t_ga5fdd6e5934a8005ef05b80f6d95883dc}{00079}}\ \textcolor{preprocessor}{\#define\ USE\_SPI3\ \ \ \ }\textcolor{comment}{///<\ Включить\ SPI3\ в\ @ref\ SPI\_MspInit}\textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00080}00080\ \textcolor{comment}{/**\ SPI\_INIT}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00081}00081\ \textcolor{comment}{\ \ *\ @\}}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00082}00082\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}\textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00083}00083\ \textcolor{comment}{/////////////////////////-\/-\/-\/USER\ SETTINGS-\/-\/-\//////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00084}00084\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{mylibs__defs_8h}{mylibs\_defs.h}}"{}}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00085}00085\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00086}00086\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00087}00087\ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00088}00088\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00089}00089\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00090}00090\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00091}00091\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00092}00092\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00093}00093\ \textcolor{comment}{////////////////////////////-\/-\/-\/DEFINES-\/-\/-\/////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00094}00094\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00095}00095\ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00096}00096\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00097}00097\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00098}00098\ \textcolor{comment}{/**}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00099}00099\ \textcolor{comment}{\ \ *\ @brief\ Структура\ настроек\ SPI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00100}00100\ \textcolor{comment}{\ \ *\ @details\ Содержит\ все\ необходимые\ параметры\ для\ инициализации\ SPI,}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00101}00101\ \textcolor{comment}{\ \ *\ включая\ GPIO\ и\ DMA.}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00102}00102\ \textcolor{comment}{\ \ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00103}\mbox{\hyperlink{struct_s_p_i___settings_type_def}{00103}}\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00104}00104\ \{}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00105}\mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{00105}}\ \ \ SPI\_HandleTypeDef\ \mbox{\hyperlink{struct_s_p_i___settings_type_def_ad203d8b8d67e4f477d002d15b03ba422}{hspi}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ HAL\ handle\ SPI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00106}00106\ \ \ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00107}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{00107}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a6a15d48eccf92959de3a086031fdc979}{CLK\_GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ CLK}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00108}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{00108}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a3bcb1ed12da3544e02e6d36493669bdc}{CLK\_PIN}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ CLK}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00109}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{00109}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a3f3748103a0b7861f6700042fd691ba1}{CLK\_GPIO\_AlternageFunc}};\ \ \ \textcolor{comment}{///<\ Альтернативная\ функция\ для\ CLK}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00110}00110\ \ \ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00111}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{00111}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0d55a2941854f61934487f3d209cfa95}{MISO\_GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ MISO}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00112}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{00112}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a3366c654d7ec6dd41c6a0b504dc8509a}{MISO\_PIN}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ MISO}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00113}\mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{00113}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_aecd7a5c6e205335b8ed229d74cd35d14}{MISO\_GPIO\_AlternageFunc}};\ \ \textcolor{comment}{///<\ Альтернативная\ функция\ для\ MISO}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00114}00114\ \ \ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00115}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{00115}}\ \ \ GPIO\_TypeDef\ \ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a0af3bdb273818ff97eb4ff3cff918820}{MOSI\_GPIOx}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Порт\ MOSI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00116}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{00116}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_a961208869faf4a7369aaf4edde75f176}{MOSI\_PIN}};\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Пин\ MOSI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00117}\mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{00117}}\ \ \ uint32\_t\ \ \ \ \ \ \mbox{\hyperlink{struct_s_p_i___settings_type_def_afbe75a1c36650a4a9b41fa706a4c7eab}{MOSI\_GPIO\_AlternageFunc}};\ \ \textcolor{comment}{///<\ Альтернативная\ функция\ для\ MOSI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00118}00118\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00119}\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3cfd9469b0617a68bbd2a161ba06bb95}{00119}}\ \ \ DMA\_Stream\_TypeDef\ *\mbox{\hyperlink{struct_s_p_i___settings_type_def_a3cfd9469b0617a68bbd2a161ba06bb95}{DMAChannel}};\ \ \ \ \ \ \ \ \ \textcolor{comment}{///<\ Канал\ DMA\ (NULL\ если\ не\ нужен)}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00120}\mbox{\hyperlink{struct_s_p_i___settings_type_def_aa0edaa145076d2383b3e0095d156d474}{00120}}\ \ \ 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_l00121}00121\ \ \ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00122}00122\ \}\ \mbox{\hyperlink{struct_s_p_i___settings_type_def}{SPI\_SettingsTypeDef}};\textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00123}00123\ \textcolor{comment}{///////////////////////-\/-\/-\/STRUCTURES\ \&\ ENUMS-\/-\/-\///////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00124}00124\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00125}00125\ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00126}00126\ \textcolor{comment}{/////////////////////////////////////////////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00127}00127\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00128}00128\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00129}00129\ \textcolor{comment}{/*\ Инициализация\ SPI\ с\ использованием\ структуры\ настроек\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00130}00130\ HAL\_StatusTypeDef\ \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\_SettingsTypeDef}}\ *sspi);}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00131}00131\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00132}00132\ \textcolor{comment}{/*\ Проверка\ корректности\ структуры\ настроек\ SPI\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00133}00133\ HAL\_StatusTypeDef\ \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\_SettingsTypeDef}}\ *sspi);}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00134}00134\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00135}00135\ \textcolor{comment}{/*\ Инициализация\ тактирования\ и\ прерываний\ для\ выбранного\ SPI\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00136}00136\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_gab9f13318daf02bc5b5f302ae392dccac}{SPI\_MspInit}}(SPI\_HandleTypeDef\ *hspi);}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00137}00137\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00138}00138\ \textcolor{comment}{/*\ Деинициализация\ тактирования\ и\ прерываний\ для\ выбранного\ SPI\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00139}00139\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y___l_i_b_s___s_p_i_gac279cc3eaa35541edfe330a1844a85e4}{SPI\_MspDeInit}}(SPI\_HandleTypeDef\ *hspi);}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00140}00140\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00141}00141\ \ \ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00142}00142\ \textcolor{comment}{/**\ }}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00143}00143\ \textcolor{comment}{\ *\ @cond\ SPI\_INTERNAL}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00144}00144\ \textcolor{comment}{\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00145}00145\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00146}00146\ \textcolor{comment}{/*\ Настройка\ GPIO\ для\ SPI\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00147}00147\ \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_l00148}00148\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00149}00149\ \textcolor{comment}{/*\ Настройка\ DMA\ для\ SPI\ */}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00150}00150\ \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_l00151}00151\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00152}00152\ \textcolor{preprocessor}{\#ifndef\ \_\_USER\_LINKDMA}\textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00153}00153\ \textcolor{comment}{/**\ \ }}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00154}00154\ \textcolor{comment}{\ \ *\ @brief\ \ Аналог\ HAL\ макроса\ для\ привязки\ DMA\ к\ UART.}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00155}00155\ \textcolor{comment}{\ \ *\ @note\ \ \ @ref\ \_\_HAL\_LINKDMA.}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00156}00156\ \textcolor{comment}{\ \ */}\textcolor{preprocessor}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00157}00157\ \textcolor{preprocessor}{\#define\ \_\_USER\_LINKDMA(\_\_HANDLE\_\_,\ \_\_PPP\_DMA\_FIELD\_\_,\ \_\_DMA\_HANDLE\_\_)\ \ \ \(\backslash\)}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00158}00158\ \textcolor{preprocessor}{do\{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00159}00159\ \textcolor{preprocessor}{(\_\_HANDLE\_\_)-\/>\_\_PPP\_DMA\_FIELD\_\_\ =\ (\_\_DMA\_HANDLE\_\_);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00160}00160\ \textcolor{preprocessor}{(\_\_DMA\_HANDLE\_\_)-\/>Parent\ =\ (\_\_HANDLE\_\_);\}\ while(0U)}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00161}00161\ \textcolor{preprocessor}{\#endif}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00162}00162\ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00163}00163\ \textcolor{comment}{/**\ @endcond\ */}\textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00164}00164\ \textcolor{comment}{///////////////////////////-\/-\/-\/FUNCTIONS-\/-\/-\////////////////////////////}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00165}00165\ }
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00166}00166\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_SPI\_GENERAL\_H\_}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00167}00167\ \textcolor{comment}{}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00168}00168\ \textcolor{comment}{/**\ MY\_LIBS\_SPI}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00169}00169\ \textcolor{comment}{\ \ *\ @\}}}
 | 
						||
\DoxyCodeLine{\Hypertarget{general__spi_8h_source_l00170}00170\ \textcolor{comment}{\ \ */}}
 | 
						||
 | 
						||
\end{DoxyCode}
 |