\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}
