123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821 |
- /**
- ******************************************************************************
- * @file stm32l4xx_hal_pssi.c
- * @author MCD Application Team
- * @brief PSSI HAL module driver.
- * This file provides firmware functions to manage the following
- * functionalities of the Parallel Synchronous Slave Interface (PSSI) peripheral:
- * + Initialization and de-initialization functions
- * + IO operation functions
- * + Peripheral State and Errors functions
- *
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.
- *
- * This software is licensed under terms that can be found in the LICENSE file
- * in the root directory of this software component.
- * If no LICENSE file comes with this software, it is provided AS-IS.
- *
- ******************************************************************************
- @verbatim
- ==============================================================================
- ##### How to use this driver #####
- ==============================================================================
- [..]
- The PSSI HAL driver can be used as follows:
- (#) Declare a PSSI_HandleTypeDef handle structure, for example:
- PSSI_HandleTypeDef hpssi;
- (#) Initialize the PSSI low level resources by implementing the @ref HAL_PSSI_MspInit() API:
- (##) Enable the PSSIx interface clock
- (##) PSSI pins configuration
- (+++) Enable the clock for the PSSI GPIOs
- (+++) Configure PSSI pins as alternate function open-drain
- (##) NVIC configuration if you need to use interrupt process
- (+++) Configure the PSSIx interrupt priority
- (+++) Enable the NVIC PSSI IRQ Channel
- (##) DMA Configuration if you need to use DMA process
- (+++) Declare DMA_HandleTypeDef handles structure for the transmit and receive
- (+++) Enable the DMAx interface clock
- (+++) Configure the DMA handle parameters
- (+++) Configure the DMA Tx and Rx
- (+++) Associate the initialized DMA handle to the hpssi DMA Tx and Rx handle
- (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on
- the DMA Tx and Rx
- (#) Configure the Communication Bus Width, Control Signals, Input Polarity and Output Polarity
- in the hpssi Init structure.
- (#) Initialize the PSSI registers by calling the @ref HAL_PSSI_Init(), configure also the low level Hardware
- (GPIO, CLOCK, NVIC...etc) by calling the customized @ref HAL_PSSI_MspInit(&hpssi) API.
- (#) For PSSI IO operations, two operation modes are available within this driver :
- *** Polling mode IO operation ***
- =================================
- [..]
- (+) Transmit an amount of data by byte in blocking mode using @ref HAL_PSSI_Transmit()
- (+) Receive an amount of data by byte in blocking mode using @ref HAL_PSSI_Receive()
- *** DMA mode IO operation ***
- ==============================
- [..]
- (+) Transmit an amount of data in non-blocking mode (DMA) using
- @ref HAL_PSSI_Transmit_DMA()
- (+) At transmission end of transfer, @ref HAL_PSSI_TxCpltCallback() is executed and user can
- add his own code by customization of function pointer @ref HAL_PSSI_TxCpltCallback()
- (+) Receive an amount of data in non-blocking mode (DMA) using
- @ref HAL_PSSI_Receive_DMA()
- (+) At reception end of transfer, @ref HAL_PSSI_RxCpltCallback() is executed and user can
- add his own code by customization of function pointer @ref HAL_PSSI_RxCpltCallback()
- (+) In case of transfer Error, @ref HAL_PSSI_ErrorCallback() function is executed and user can
- add his own code by customization of function pointer @ref HAL_PSSI_ErrorCallback()
- (+) Abort a PSSI process communication with Interrupt using @ref HAL_PSSI_Abort_IT()
- (+) End of abort process, @ref HAL_PSSI_AbortCpltCallback() is executed and user can
- add his own code by customization of function pointer @ref HAL_PSSI_AbortCpltCallback()
- *** PSSI HAL driver macros list ***
- ==================================
- [..]
- Below the list of most used macros in PSSI HAL driver.
- (+) @ref HAL_PSSI_ENABLE : Enable the PSSI peripheral
- (+) @ref HAL_PSSI_DISABLE : Disable the PSSI peripheral
- (+) @ref HAL_PSSI_GET_FLAG : Check whether the specified PSSI flag is set or not
- (+) @ref HAL_PSSI_CLEAR_FLAG : Clear the specified PSSI pending flag
- (+) @ref HAL_PSSI_ENABLE_IT : Enable the specified PSSI interrupt
- (+) @ref HAL_PSSI_DISABLE_IT : Disable the specified PSSI interrupt
- *** Callback registration ***
- =============================================
- Use Functions @ref HAL_PSSI_RegisterCallback() or @ref HAL_PSSI_RegisterAddrCallback()
- to register an interrupt callback.
- Function @ref HAL_PSSI_RegisterCallback() allows to register following callbacks:
- (+) TxCpltCallback : callback for transmission end of transfer.
- (+) RxCpltCallback : callback for reception end of transfer.
- (+) ErrorCallback : callback for error detection.
- (+) AbortCpltCallback : callback for abort completion process.
- (+) MspInitCallback : callback for Msp Init.
- (+) MspDeInitCallback : callback for Msp DeInit.
- This function takes as parameters the HAL peripheral handle, the Callback ID
- and a pointer to the user callback function.
- Use function @ref HAL_PSSI_UnRegisterCallback to reset a callback to the default
- weak function.
- @ref HAL_PSSI_UnRegisterCallback takes as parameters the HAL peripheral handle,
- and the Callback ID.
- This function allows to reset following callbacks:
- (+) TxCpltCallback : callback for transmission end of transfer.
- (+) RxCpltCallback : callback for reception end of transfer.
- (+) ErrorCallback : callback for error detection.
- (+) AbortCpltCallback : callback for abort completion process.
- (+) MspInitCallback : callback for Msp Init.
- (+) MspDeInitCallback : callback for Msp DeInit.
- By default, after the @ref HAL_PSSI_Init() and when the state is @ref HAL_PSSI_STATE_RESET
- all callbacks are set to the corresponding weak functions:
- examples @ref HAL_PSSI_TxCpltCallback(), @ref HAL_PSSI_RxCpltCallback().
- Exception done for MspInit and MspDeInit functions that are
- reset to the legacy weak functions in the @ref HAL_PSSI_Init()/ @ref HAL_PSSI_DeInit() only when
- these callbacks are null (not registered beforehand).
- If MspInit or MspDeInit are not null, the @ref HAL_PSSI_Init()/ @ref HAL_PSSI_DeInit()
- keep and use the user MspInit/MspDeInit callbacks (registered beforehand) whatever the state.
- Callbacks can be registered/unregistered in @ref HAL_PSSI_STATE_READY state only.
- Exception done MspInit/MspDeInit functions that can be registered/unregistered
- in @ref HAL_PSSI_STATE_READY or @ref HAL_PSSI_STATE_RESET state,
- thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit.
- Then, the user first registers the MspInit/MspDeInit user callbacks
- using @ref HAL_PSSI_RegisterCallback() before calling @ref HAL_PSSI_DeInit()
- or @ref HAL_PSSI_Init() function.
- [..]
- (@) You can refer to the PSSI HAL driver header file for more useful macros
- @endverbatim
- */
- /* Includes ------------------------------------------------------------------*/
- #include "stm32l4xx_hal.h"
- /** @addtogroup STM32L4xx_HAL_Driver
- * @{
- */
- /** @defgroup PSSI PSSI
- * @brief PSSI HAL module driver
- * @{
- */
- #ifdef HAL_PSSI_MODULE_ENABLED
- #if defined(PSSI)
- /* Private typedef -----------------------------------------------------------*/
- /* Private define ------------------------------------------------------------*/
- /** @defgroup PSSI_Private_Define PSSI Private Define
- * @{
- */
- /**
- * @}
- */
- /* Private macro -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /* Private function prototypes -----------------------------------------------*/
- /** @defgroup PSSI_Private_Functions PSSI Private Functions
- * @{
- */
- /* Private functions to handle DMA transfer */
- #if defined(HAL_DMA_MODULE_ENABLED)
- void PSSI_DMATransmitCplt(DMA_HandleTypeDef *hdma);
- void PSSI_DMAReceiveCplt(DMA_HandleTypeDef *hdma);
- void PSSI_DMAError(DMA_HandleTypeDef *hdma);
- void PSSI_DMAAbort(DMA_HandleTypeDef *hdma);
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /* Private functions to handle IT transfer */
- static void PSSI_Error(PSSI_HandleTypeDef *hpssi, uint32_t ErrorCode);
- /* Private functions for PSSI transfer IRQ handler */
- /* Private functions to handle flags during polling transfer */
- static HAL_StatusTypeDef PSSI_WaitOnStatusUntilTimeout(PSSI_HandleTypeDef *hpssi, uint32_t Flag, FlagStatus Status,
- uint32_t Timeout, uint32_t Tickstart);
- /* Private functions to centralize the enable/disable of Interrupts */
- /**
- * @}
- */
- /* Exported functions --------------------------------------------------------*/
- /** @defgroup PSSI_Exported_Functions PSSI Exported Functions
- * @{
- */
- /** @defgroup PSSI_Exported_Functions_Group1 Initialization and de-initialization functions
- * @brief Initialization and Configuration functions
- *
- @verbatim
- ===============================================================================
- ##### Initialization and de-initialization functions #####
- ===============================================================================
- [..] This subsection provides a set of functions allowing to initialize and
- deinitialize the PSSIx peripheral:
- (+) User must implement HAL_PSSI_MspInit() function in which he configures
- all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ).
- (+) Call the function HAL_PSSI_Init() to configure the selected device with
- the selected configuration:
- (++) Data Width
- (++) Control Signals
- (++) Input Clock polarity
- (++) Output Clock polarity
- (+) Call the function HAL_PSSI_DeInit() to restore the default configuration
- of the selected PSSIx peripheral.
- @endverbatim
- * @{
- */
- /**
- * @brief Initializes the PSSI according to the specified parameters
- * in the PSSI_InitTypeDef and initialize the associated handle.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_Init(PSSI_HandleTypeDef *hpssi)
- {
- /* Check the PSSI handle allocation */
- if (hpssi == NULL)
- {
- return HAL_ERROR;
- }
- /* Check the parameters */
- assert_param(IS_PSSI_ALL_INSTANCE(hpssi->Instance));
- assert_param(IS_PSSI_CONTROL_SIGNAL(hpssi->Init.ControlSignal));
- assert_param(IS_PSSI_BUSWIDTH(hpssi->Init.BusWidth));
- assert_param(IS_PSSI_CLOCK_POLARITY(hpssi->Init.ClockPolarity));
- assert_param(IS_PSSI_DE_POLARITY(hpssi->Init.DataEnablePolarity));
- assert_param(IS_PSSI_RDY_POLARITY(hpssi->Init.ReadyPolarity));
- if (hpssi->State == HAL_PSSI_STATE_RESET)
- {
- /* Allocate lock resource and initialize it */
- hpssi->Lock = HAL_UNLOCKED;
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- /* Init the PSSI Callback settings */
- hpssi->TxCpltCallback = HAL_PSSI_TxCpltCallback; /* Legacy weak TxCpltCallback */
- hpssi->RxCpltCallback = HAL_PSSI_RxCpltCallback; /* Legacy weak RxCpltCallback */
- hpssi->ErrorCallback = HAL_PSSI_ErrorCallback; /* Legacy weak ErrorCallback */
- hpssi->AbortCpltCallback = HAL_PSSI_AbortCpltCallback; /* Legacy weak AbortCpltCallback */
- if (hpssi->MspInitCallback == NULL)
- {
- hpssi->MspInitCallback = HAL_PSSI_MspInit; /* Legacy weak MspInit */
- }
- /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */
- hpssi->MspInitCallback(hpssi);
- #else
- /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */
- HAL_PSSI_MspInit(hpssi);
- #endif /*USE_HAL_PSSI_REGISTER_CALLBACKS*/
- }
- hpssi->State = HAL_PSSI_STATE_BUSY;
- /* Disable the selected PSSI peripheral */
- HAL_PSSI_DISABLE(hpssi);
- /*---------------------------- PSSIx CR Configuration ----------------------*/
- /* Configure PSSIx: Control Signal and Bus Width*/
- MODIFY_REG(hpssi->Instance->CR, PSSI_CR_DERDYCFG | PSSI_CR_EDM | PSSI_CR_DEPOL | PSSI_CR_RDYPOL,
- hpssi->Init.ControlSignal | hpssi->Init.DataEnablePolarity |
- hpssi->Init.ReadyPolarity | hpssi->Init.BusWidth);
- hpssi->ErrorCode = HAL_PSSI_ERROR_NONE;
- hpssi->State = HAL_PSSI_STATE_READY;
- return HAL_OK;
- }
- /**
- * @brief DeInitialize the PSSI peripheral.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_DeInit(PSSI_HandleTypeDef *hpssi)
- {
- /* Check the PSSI handle allocation */
- if (hpssi == NULL)
- {
- return HAL_ERROR;
- }
- /* Check the parameters */
- assert_param(IS_PSSI_ALL_INSTANCE(hpssi->Instance));
- hpssi->State = HAL_PSSI_STATE_BUSY;
- /* Disable the PSSI Peripheral Clock */
- HAL_PSSI_DISABLE(hpssi);
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- if (hpssi->MspDeInitCallback == NULL)
- {
- hpssi->MspDeInitCallback = HAL_PSSI_MspDeInit; /* Legacy weak MspDeInit */
- }
- /* DeInit the low level hardware: GPIO, CLOCK, NVIC */
- hpssi->MspDeInitCallback(hpssi);
- #else
- /* DeInit the low level hardware: GPIO, CLOCK, NVIC */
- HAL_PSSI_MspDeInit(hpssi);
- #endif /*USE_HAL_PSSI_REGISTER_CALLBACKS*/
- hpssi->ErrorCode = HAL_PSSI_ERROR_NONE;
- hpssi->State = HAL_PSSI_STATE_RESET;
- /* Release Lock */
- __HAL_UNLOCK(hpssi);
- return HAL_OK;
- }
- /**
- * @brief Initialize the PSSI MSP.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- __weak void HAL_PSSI_MspInit(PSSI_HandleTypeDef *hpssi)
- {
- /* Prevent unused argument(s) compilation warning */
- UNUSED(hpssi);
- /* NOTE : This function should not be modified, when the callback is needed,
- the HAL_PSSI_MspInit can be implemented in the user file
- */
- }
- /**
- * @brief De-Initialize the PSSI MSP.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- __weak void HAL_PSSI_MspDeInit(PSSI_HandleTypeDef *hpssi)
- {
- /* Prevent unused argument(s) compilation warning */
- UNUSED(hpssi);
- /* NOTE : This function should not be modified; when the callback is needed,
- the HAL_PSSI_MspDeInit can be implemented in the user file
- */
- }
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- /**
- * @brief Register a User PSSI Callback
- * To be used instead of the weak predefined callback
- * @note The HAL_PSSI_RegisterCallback() may be called before HAL_PSSI_Init() in
- * HAL_PSSI_STATE_RESET to register callbacks for HAL_PSSI_MSPINIT_CB_ID
- * and HAL_PSSI_MSPDEINIT_CB_ID.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param CallbackID ID of the callback to be registered
- * This parameter can be one of the following values:
- * @arg @ref HAL_PSSI_TX_COMPLETE_CB_ID Tx Transfer completed callback ID
- * @arg @ref HAL_PSSI_RX_COMPLETE_CB_ID Rx Transfer completed callback ID
- * @arg @ref HAL_PSSI_ERROR_CB_ID Error callback ID
- * @arg @ref HAL_PSSI_ABORT_CB_ID Abort callback ID
- * @arg @ref HAL_PSSI_MSPINIT_CB_ID MspInit callback ID
- * @arg @ref HAL_PSSI_MSPDEINIT_CB_ID MspDeInit callback ID
- * @param pCallback pointer to the Callback function
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_RegisterCallback(PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID,
- pPSSI_CallbackTypeDef pCallback)
- {
- HAL_StatusTypeDef status = HAL_OK;
- if (pCallback == NULL)
- {
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- return HAL_ERROR;
- }
- if (HAL_PSSI_STATE_READY == hpssi->State)
- {
- switch (CallbackID)
- {
- case HAL_PSSI_TX_COMPLETE_CB_ID :
- hpssi->TxCpltCallback = pCallback;
- break;
- case HAL_PSSI_RX_COMPLETE_CB_ID :
- hpssi->RxCpltCallback = pCallback;
- break;
- case HAL_PSSI_ERROR_CB_ID :
- hpssi->ErrorCallback = pCallback;
- break;
- case HAL_PSSI_ABORT_CB_ID :
- hpssi->AbortCpltCallback = pCallback;
- break;
- case HAL_PSSI_MSPINIT_CB_ID :
- hpssi->MspInitCallback = pCallback;
- break;
- case HAL_PSSI_MSPDEINIT_CB_ID :
- hpssi->MspDeInitCallback = pCallback;
- break;
- default :
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- /* Return error status */
- status = HAL_ERROR;
- break;
- }
- }
- else if (HAL_PSSI_STATE_RESET == hpssi->State)
- {
- switch (CallbackID)
- {
- case HAL_PSSI_MSPINIT_CB_ID :
- hpssi->MspInitCallback = pCallback;
- break;
- case HAL_PSSI_MSPDEINIT_CB_ID :
- hpssi->MspDeInitCallback = pCallback;
- break;
- default :
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- /* Return error status */
- status = HAL_ERROR;
- break;
- }
- }
- else
- {
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- /* Return error status */
- status = HAL_ERROR;
- }
- return status;
- }
- /**
- * @brief Unregister an PSSI Callback
- * PSSI callback is redirected to the weak predefined callback
- * @note The HAL_PSSI_UnRegisterCallback() may be called before HAL_PSSI_Init() in
- * HAL_PSSI_STATE_RESET to un-register callbacks for HAL_PSSI_MSPINIT_CB_ID
- * and HAL_PSSI_MSPDEINIT_CB_ID.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param CallbackID ID of the callback to be unregistered
- * This parameter can be one of the following values:
- * @arg @ref HAL_PSSI_TX_COMPLETE_CB_ID Tx Transfer completed callback ID
- * @arg @ref HAL_PSSI_RX_COMPLETE_CB_ID Rx Transfer completed callback ID
- * @arg @ref HAL_PSSI_ERROR_CB_ID Error callback ID
- * @arg @ref HAL_PSSI_ABORT_CB_ID Abort callback ID
- * @arg @ref HAL_PSSI_MSPINIT_CB_ID MspInit callback ID
- * @arg @ref HAL_PSSI_MSPDEINIT_CB_ID MspDeInit callback ID
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_UnRegisterCallback(PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID)
- {
- HAL_StatusTypeDef status = HAL_OK;
- if (HAL_PSSI_STATE_READY == hpssi->State)
- {
- switch (CallbackID)
- {
- case HAL_PSSI_TX_COMPLETE_CB_ID :
- hpssi->TxCpltCallback = HAL_PSSI_TxCpltCallback; /* Legacy weak TxCpltCallback */
- break;
- case HAL_PSSI_RX_COMPLETE_CB_ID :
- hpssi->RxCpltCallback = HAL_PSSI_RxCpltCallback; /* Legacy weak RxCpltCallback */
- break;
- case HAL_PSSI_ERROR_CB_ID :
- hpssi->ErrorCallback = HAL_PSSI_ErrorCallback; /* Legacy weak ErrorCallback */
- break;
- case HAL_PSSI_ABORT_CB_ID :
- hpssi->AbortCpltCallback = HAL_PSSI_AbortCpltCallback; /* Legacy weak AbortCpltCallback */
- break;
- case HAL_PSSI_MSPINIT_CB_ID :
- hpssi->MspInitCallback = HAL_PSSI_MspInit; /* Legacy weak MspInit */
- break;
- case HAL_PSSI_MSPDEINIT_CB_ID :
- hpssi->MspDeInitCallback = HAL_PSSI_MspDeInit; /* Legacy weak MspDeInit */
- break;
- default :
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- /* Return error status */
- status = HAL_ERROR;
- break;
- }
- }
- else if (HAL_PSSI_STATE_RESET == hpssi->State)
- {
- switch (CallbackID)
- {
- case HAL_PSSI_MSPINIT_CB_ID :
- hpssi->MspInitCallback = HAL_PSSI_MspInit; /* Legacy weak MspInit */
- break;
- case HAL_PSSI_MSPDEINIT_CB_ID :
- hpssi->MspDeInitCallback = HAL_PSSI_MspDeInit; /* Legacy weak MspDeInit */
- break;
- default :
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- /* Return error status */
- status = HAL_ERROR;
- break;
- }
- }
- else
- {
- /* Update the error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_INVALID_CALLBACK;
- /* Return error status */
- status = HAL_ERROR;
- }
- return status;
- }
- #endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
- /**
- * @}
- */
- /** @defgroup PSSI_Exported_Functions_Group2 Input and Output operation functions
- * @brief Data transfers functions
- *
- @verbatim
- ===============================================================================
- ##### IO operation functions #####
- ===============================================================================
- [..]
- This subsection provides a set of functions allowing to manage the PSSI data
- transfers.
- (#) There are two modes of transfer:
- (++) Blocking mode : The communication is performed in the polling mode.
- The status of all data processing is returned by the same function
- after finishing transfer.
- (++) No-Blocking mode : The communication is performed using DMA.
- These functions return the status of the transfer startup.
- The end of the data processing will be indicated through the
- dedicated the DMA IRQ .
- (#) Blocking mode functions are :
- (++) HAL_PSSI_Transmit()
- (++) HAL_PSSI_Receive()
- (#) No-Blocking mode functions with DMA are :
- (++) HAL_PSSI_Transmit_DMA()
- (++) HAL_PSSI_Receive_DMA()
- (#) A set of Transfer Complete Callbacks are provided in non Blocking mode:
- (++) HAL_PSSI_TxCpltCallback()
- (++) HAL_PSSI_RxCpltCallback()
- (++) HAL_PSSI_ErrorCallback()
- (++) HAL_PSSI_AbortCpltCallback()
- @endverbatim
- * @{
- */
- /**
- * @brief Transmits in master mode an amount of data in blocking mode.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param pData Pointer to data buffer
- * @param Size Amount of data to be sent (in bytes)
- * @param Timeout Timeout duration
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_Transmit(PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout)
- {
- uint32_t tickstart;
- uint32_t transfer_size = Size;
- if (((hpssi->Init.DataWidth == HAL_PSSI_8BITS) && (hpssi->Init.BusWidth != HAL_PSSI_8LINES)) ||
- ((hpssi->Init.DataWidth == HAL_PSSI_16BITS) && ((Size % 2U) != 0U)) ||
- ((hpssi->Init.DataWidth == HAL_PSSI_32BITS) && ((Size % 4U) != 0U)))
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_NOT_SUPPORTED;
- return HAL_ERROR;
- }
- if (hpssi->State == HAL_PSSI_STATE_READY)
- {
- /* Process Locked */
- __HAL_LOCK(hpssi);
- hpssi->State = HAL_PSSI_STATE_BUSY;
- hpssi->ErrorCode = HAL_PSSI_ERROR_NONE;
- /* Disable the selected PSSI peripheral */
- HAL_PSSI_DISABLE(hpssi);
- /* Configure transfer parameters */
- MODIFY_REG(hpssi->Instance->CR, (PSSI_CR_OUTEN | PSSI_CR_CKPOL),
- (PSSI_CR_OUTEN_OUTPUT |((hpssi->Init.ClockPolarity == HAL_PSSI_RISING_EDGE) ? 0U : PSSI_CR_CKPOL)));
- #if defined(HAL_DMA_MODULE_ENABLED)
- /* DMA Disable */
- hpssi->Instance->CR &= PSSI_CR_DMA_DISABLE;
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /* Enable the selected PSSI peripheral */
- HAL_PSSI_ENABLE(hpssi);
- if (hpssi->Init.DataWidth == HAL_PSSI_8BITS)
- {
- uint8_t *pbuffer = pData;
- while (transfer_size > 0U)
- {
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- /* Wait until Fifo is ready to transfer one byte flag is set */
- if (PSSI_WaitOnStatusUntilTimeout(hpssi, PSSI_FLAG_RTT1B, RESET, Timeout, tickstart) != HAL_OK)
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Write data to DR */
- *(__IO uint8_t *)(&hpssi->Instance->DR) = *(uint8_t *)pbuffer;
- /* Increment Buffer pointer */
- pbuffer++;
- transfer_size--;
- }
- }
- else if (hpssi->Init.DataWidth == HAL_PSSI_16BITS)
- {
- uint16_t *pbuffer = (uint16_t *)pData;
- __IO uint16_t *dr = (__IO uint16_t *)(&hpssi->Instance->DR);
- while (transfer_size > 0U)
- {
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- /* Wait until Fifo is ready to transfer four bytes flag is set */
- if (PSSI_WaitOnStatusUntilTimeout(hpssi, PSSI_FLAG_RTT4B, RESET, Timeout, tickstart) != HAL_OK)
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Write data to DR */
- *dr = *pbuffer;
- /* Increment Buffer pointer */
- pbuffer++;
- transfer_size -= 2U;
- }
- }
- else if (hpssi->Init.DataWidth == HAL_PSSI_32BITS)
- {
- uint32_t *pbuffer = (uint32_t *)pData;
- while (transfer_size > 0U)
- {
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- /* Wait until Fifo is ready to transfer four bytes flag is set */
- if (PSSI_WaitOnStatusUntilTimeout(hpssi, PSSI_FLAG_RTT4B, RESET, Timeout, tickstart) != HAL_OK)
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Write data to DR */
- *(__IO uint32_t *)(&hpssi->Instance->DR) = *pbuffer;
- /* Increment Buffer pointer */
- pbuffer++;
- transfer_size -= 4U;
- }
- }
- else
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_NOT_SUPPORTED;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Check Errors Flags */
- if (HAL_PSSI_GET_FLAG(hpssi, PSSI_FLAG_OVR_RIS) != 0U)
- {
- HAL_PSSI_CLEAR_FLAG(hpssi, PSSI_FLAG_OVR_RIS);
- HAL_PSSI_DISABLE(hpssi);
- hpssi->ErrorCode = HAL_PSSI_ERROR_UNDER_RUN;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_OK;
- }
- else
- {
- return HAL_BUSY;
- }
- }
- /**
- * @brief Receives an amount of data in blocking mode.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param pData Pointer to data buffer
- * @param Size Amount of data to be received (in bytes)
- * @param Timeout Timeout duration
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_Receive(PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout)
- {
- uint32_t tickstart;
- uint32_t transfer_size = Size;
- if (((hpssi->Init.DataWidth == HAL_PSSI_8BITS) && (hpssi->Init.BusWidth != HAL_PSSI_8LINES)) ||
- ((hpssi->Init.DataWidth == HAL_PSSI_16BITS) && ((Size % 2U) != 0U)) ||
- ((hpssi->Init.DataWidth == HAL_PSSI_32BITS) && ((Size % 4U) != 0U)))
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_NOT_SUPPORTED;
- return HAL_ERROR;
- }
- if (hpssi->State == HAL_PSSI_STATE_READY)
- {
- /* Process Locked */
- __HAL_LOCK(hpssi);
- hpssi->State = HAL_PSSI_STATE_BUSY;
- hpssi->ErrorCode = HAL_PSSI_ERROR_NONE;
- /* Disable the selected PSSI peripheral */
- HAL_PSSI_DISABLE(hpssi);
- /* Configure transfer parameters */
- MODIFY_REG(hpssi->Instance->CR, (PSSI_CR_OUTEN | PSSI_CR_CKPOL),
- (PSSI_CR_OUTEN_INPUT | ((hpssi->Init.ClockPolarity == HAL_PSSI_FALLING_EDGE) ? 0U : PSSI_CR_CKPOL)));
- #if defined(HAL_DMA_MODULE_ENABLED)
- /* DMA Disable */
- hpssi->Instance->CR &= PSSI_CR_DMA_DISABLE;
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /* Enable the selected PSSI peripheral */
- HAL_PSSI_ENABLE(hpssi);
- if (hpssi->Init.DataWidth == HAL_PSSI_8BITS)
- {
- uint8_t *pbuffer = pData;
- while (transfer_size > 0U)
- {
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- /* Wait until Fifo is ready to receive one byte flag is set */
- if (PSSI_WaitOnStatusUntilTimeout(hpssi, PSSI_FLAG_RTT1B, RESET, Timeout, tickstart) != HAL_OK)
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Read data from DR */
- *pbuffer = *(__IO uint8_t *)(&hpssi->Instance->DR);
- pbuffer++;
- transfer_size--;
- }
- }
- else if (hpssi->Init.DataWidth == HAL_PSSI_16BITS)
- {
- uint16_t *pbuffer = (uint16_t *)pData;
- __IO uint16_t *dr = (__IO uint16_t *)(&hpssi->Instance->DR);
- while (transfer_size > 0U)
- {
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- /* Wait until Fifo is ready to receive four bytes flag is set */
- if (PSSI_WaitOnStatusUntilTimeout(hpssi, PSSI_FLAG_RTT4B, RESET, Timeout, tickstart) != HAL_OK)
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Read data from DR */
- *pbuffer = *dr;
- pbuffer++;
- transfer_size -= 2U;
- }
- }
- else if (hpssi->Init.DataWidth == HAL_PSSI_32BITS)
- {
- uint32_t *pbuffer = (uint32_t *)pData;
- while (transfer_size > 0U)
- {
- /* Init tickstart for timeout management*/
- tickstart = HAL_GetTick();
- /* Wait until Fifo is ready to receive four bytes flag is set */
- if (PSSI_WaitOnStatusUntilTimeout(hpssi, PSSI_FLAG_RTT4B, RESET, Timeout, tickstart) != HAL_OK)
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Read data from DR */
- *pbuffer = *(__IO uint32_t *)(&hpssi->Instance->DR);
- pbuffer++;
- transfer_size -= 4U;
- }
- }
- else
- {
- hpssi->ErrorCode = HAL_PSSI_ERROR_NOT_SUPPORTED;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- /* Check Errors Flags */
- if (HAL_PSSI_GET_FLAG(hpssi, PSSI_FLAG_OVR_RIS) != 0U)
- {
- HAL_PSSI_CLEAR_FLAG(hpssi, PSSI_FLAG_OVR_RIS);
- hpssi->ErrorCode = HAL_PSSI_ERROR_OVER_RUN;
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_OK;
- }
- else
- {
- return HAL_BUSY;
- }
- }
- #if defined(HAL_DMA_MODULE_ENABLED)
- /**
- * @brief Transmit an amount of data in non-blocking mode with DMA
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param pData Pointer to data buffer
- * @param Size Amount of data to be sent (in bytes)
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_Transmit_DMA(PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size)
- {
- HAL_StatusTypeDef dmaxferstatus;
- if (hpssi->State == HAL_PSSI_STATE_READY)
- {
- /* Process Locked */
- __HAL_LOCK(hpssi);
- hpssi->State = HAL_PSSI_STATE_BUSY_TX;
- hpssi->ErrorCode = HAL_PSSI_ERROR_NONE;
- /* Disable the selected PSSI peripheral */
- HAL_PSSI_DISABLE(hpssi);
- /* Prepare transfer parameters */
- hpssi->pBuffPtr = pData;
- hpssi->XferCount = Size;
- if (hpssi->XferCount > PSSI_MAX_NBYTE_SIZE)
- {
- hpssi->XferSize = PSSI_MAX_NBYTE_SIZE;
- }
- else
- {
- hpssi->XferSize = hpssi->XferCount;
- }
- if (hpssi->XferSize > 0U)
- {
- if (hpssi->hdmatx != NULL)
- {
- /* Configure BusWidth */
- if (hpssi->hdmatx->Init.PeriphDataAlignment == DMA_PDATAALIGN_BYTE)
- {
- MODIFY_REG(hpssi->Instance->CR, PSSI_CR_DMAEN | PSSI_CR_OUTEN | PSSI_CR_CKPOL,
- PSSI_CR_DMA_ENABLE | PSSI_CR_OUTEN_OUTPUT |
- ((hpssi->Init.ClockPolarity == HAL_PSSI_RISING_EDGE) ? 0U : PSSI_CR_CKPOL));
- }
- else
- {
- MODIFY_REG(hpssi->Instance->CR, PSSI_CR_DMAEN | PSSI_CR_OUTEN | PSSI_CR_CKPOL,
- PSSI_CR_DMA_ENABLE | hpssi->Init.BusWidth | PSSI_CR_OUTEN_OUTPUT |
- ((hpssi->Init.ClockPolarity == HAL_PSSI_RISING_EDGE) ? 0U : PSSI_CR_CKPOL));
- }
- /* Set the PSSI DMA transfer complete callback */
- hpssi->hdmatx->XferCpltCallback = PSSI_DMATransmitCplt;
- /* Set the DMA error callback */
- hpssi->hdmatx->XferErrorCallback = PSSI_DMAError;
- /* Set the unused DMA callbacks to NULL */
- hpssi->hdmatx->XferHalfCpltCallback = NULL;
- hpssi->hdmatx->XferAbortCallback = NULL;
- /* Enable the DMA */
- dmaxferstatus = HAL_DMA_Start_IT(hpssi->hdmatx, (uint32_t)pData, (uint32_t)&hpssi->Instance->DR,
- hpssi->XferSize);
- }
- else
- {
- /* Update PSSI state */
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Update PSSI error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_DMA;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- if (dmaxferstatus == HAL_OK)
- {
- /* Update XferCount value */
- hpssi->XferCount -= hpssi->XferSize;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Note : The PSSI interrupts must be enabled after unlocking current process
- to avoid the risk of PSSI interrupt handle execution before current
- process unlock */
- /* Enable ERR interrupt */
- HAL_PSSI_ENABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- /* Enable DMA Request */
- hpssi->Instance->CR |= PSSI_CR_DMA_ENABLE;
- /* Enable the selected PSSI peripheral */
- HAL_PSSI_ENABLE(hpssi);
- }
- else
- {
- /* Update PSSI state */
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Update PSSI error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_DMA;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- }
- else
- {
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Note : The PSSI interrupts must be enabled after unlocking current process
- to avoid the risk of PSSI interrupt handle execution before current
- process unlock */
- /* Enable ERRinterrupt */
- /* possible to enable all of these */
- HAL_PSSI_ENABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- }
- return HAL_OK;
- }
- else
- {
- return HAL_BUSY;
- }
- }
- /**
- * @brief Receive an amount of data in non-blocking mode with DMA
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param pData Pointer to data buffer
- * @param Size Amount of data to be received (in bytes)
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_Receive_DMA(PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size)
- {
- HAL_StatusTypeDef dmaxferstatus;
- if (hpssi->State == HAL_PSSI_STATE_READY)
- {
- /* Disable the selected PSSI peripheral */
- HAL_PSSI_DISABLE(hpssi);
- /* Process Locked */
- __HAL_LOCK(hpssi);
- hpssi->State = HAL_PSSI_STATE_BUSY_RX;
- hpssi->ErrorCode = HAL_PSSI_ERROR_NONE;
- /* Prepare transfer parameters */
- hpssi->pBuffPtr = pData;
- hpssi->XferCount = Size;
- if (hpssi->XferCount > PSSI_MAX_NBYTE_SIZE)
- {
- hpssi->XferSize = PSSI_MAX_NBYTE_SIZE;
- }
- else
- {
- hpssi->XferSize = hpssi->XferCount;
- }
- if (hpssi->XferSize > 0U)
- {
- if (hpssi->hdmarx != NULL)
- {
- /* Configure BusWidth */
- if (hpssi->hdmarx->Init.PeriphDataAlignment == DMA_PDATAALIGN_BYTE)
- {
- MODIFY_REG(hpssi->Instance->CR, PSSI_CR_DMAEN | PSSI_CR_OUTEN | PSSI_CR_CKPOL, PSSI_CR_DMA_ENABLE |
- ((hpssi->Init.ClockPolarity == HAL_PSSI_RISING_EDGE) ? PSSI_CR_CKPOL : 0U));
- }
- else
- {
- MODIFY_REG(hpssi->Instance->CR, PSSI_CR_DMAEN | PSSI_CR_OUTEN | PSSI_CR_CKPOL,
- PSSI_CR_DMA_ENABLE | hpssi->Init.BusWidth |
- ((hpssi->Init.ClockPolarity == HAL_PSSI_RISING_EDGE) ? PSSI_CR_CKPOL : 0U));
- }
- /* Set the PSSI DMA transfer complete callback */
- hpssi->hdmarx->XferCpltCallback = PSSI_DMAReceiveCplt;
- /* Set the DMA error callback */
- hpssi->hdmarx->XferErrorCallback = PSSI_DMAError;
- /* Set the unused DMA callbacks to NULL */
- hpssi->hdmarx->XferHalfCpltCallback = NULL;
- hpssi->hdmarx->XferAbortCallback = NULL;
- /* Enable the DMA */
- dmaxferstatus = HAL_DMA_Start_IT(hpssi->hdmarx, (uint32_t)&hpssi->Instance->DR, (uint32_t)pData,
- hpssi->XferSize);
- }
- else
- {
- /* Update PSSI state */
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Update PSSI error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_DMA;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- if (dmaxferstatus == HAL_OK)
- {
- /* Update XferCount value */
- hpssi->XferCount -= hpssi->XferSize;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Note : The PSSI interrupts must be enabled after unlocking current process
- to avoid the risk of PSSI interrupt handle execution before current
- process unlock */
- /* Enable ERR interrupt */
- HAL_PSSI_ENABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- /* Enable DMA Request */
- hpssi->Instance->CR |= PSSI_CR_DMA_ENABLE;
- /* Enable the selected PSSI peripheral */
- HAL_PSSI_ENABLE(hpssi);
- }
- else
- {
- /* Update PSSI state */
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Update PSSI error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_DMA;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- }
- else
- {
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Enable ERR,interrupt */
- HAL_PSSI_ENABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- }
- return HAL_OK;
- }
- else
- {
- return HAL_BUSY;
- }
- }
- /**
- * @brief Abort a DMA process communication with Interrupt.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval HAL status
- */
- HAL_StatusTypeDef HAL_PSSI_Abort_DMA(PSSI_HandleTypeDef *hpssi)
- {
- /* Process Locked */
- __HAL_LOCK(hpssi);
- /* Disable Interrupts */
- HAL_PSSI_DISABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- /* Set State at HAL_PSSI_STATE_ABORT */
- hpssi->State = HAL_PSSI_STATE_ABORT;
- /* Abort DMA TX transfer if any */
- if ((hpssi->Instance->CR & PSSI_CR_DMAEN) == PSSI_CR_DMAEN)
- {
- if (hpssi->State == HAL_PSSI_STATE_BUSY_TX)
- {
- hpssi->Instance->CR &= ~PSSI_CR_DMAEN;
- if (hpssi->hdmatx != NULL)
- {
- /* Set the PSSI DMA Abort callback :
- will lead to call HAL_PSSI_ErrorCallback() at end of DMA abort procedure */
- hpssi->hdmatx->XferAbortCallback = PSSI_DMAAbort;
- /* Abort DMA TX */
- if (HAL_DMA_Abort_IT(hpssi->hdmatx) != HAL_OK)
- {
- /* Call Directly XferAbortCallback function in case of error */
- hpssi->hdmatx->XferAbortCallback(hpssi->hdmatx);
- }
- }
- }
- /* Abort DMA RX transfer if any */
- else if (hpssi->State == HAL_PSSI_STATE_BUSY_RX)
- {
- hpssi->Instance->CR &= ~PSSI_CR_DMAEN;
- if (hpssi->hdmarx != NULL)
- {
- /* Set the PSSI DMA Abort callback :
- will lead to call HAL_PSSI_ErrorCallback() at end of DMA abort procedure */
- hpssi->hdmarx->XferAbortCallback = PSSI_DMAAbort;
- /* Abort DMA RX */
- if (HAL_DMA_Abort_IT(hpssi->hdmarx) != HAL_OK)
- {
- /* Call Directly hpssi->hdma->XferAbortCallback function in case of error */
- hpssi->hdmarx->XferAbortCallback(hpssi->hdmarx);
- }
- }
- }
- else
- {
- /* Call the error callback */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->ErrorCallback(hpssi);
- #else
- HAL_PSSI_ErrorCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Note : The PSSI interrupts must be enabled after unlocking current process
- to avoid the risk of PSSI interrupt handle execution before current
- process unlock */
- HAL_PSSI_ENABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- return HAL_OK;
- }
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /**
- * @}
- */
- /** @addtogroup PSSI_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
- * @{
- */
- /**
- * @brief This function handles PSSI event interrupt request.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- void HAL_PSSI_IRQHandler(PSSI_HandleTypeDef *hpssi)
- {
- /* Overrun/ Underrun Errors */
- if (HAL_PSSI_GET_FLAG(hpssi, PSSI_FLAG_OVR_MIS) != 0U)
- {
- /* Reset handle parameters */
- hpssi->XferCount = 0U;
- /* Disable all interrupts */
- HAL_PSSI_DISABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- #if defined(HAL_DMA_MODULE_ENABLED)
- /* Abort DMA TX transfer if any */
- if ((hpssi->Instance->CR & PSSI_CR_DMAEN) == PSSI_CR_DMAEN)
- {
- if (hpssi->State == HAL_PSSI_STATE_BUSY_TX)
- {
- /* Set new error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_UNDER_RUN;
- hpssi->Instance->CR &= ~PSSI_CR_DMAEN;
- if (hpssi->hdmatx != NULL)
- {
- /* Set the PSSI DMA Abort callback :
- will lead to call HAL_PSSI_ErrorCallback() at end of DMA abort procedure */
- hpssi->hdmatx->XferAbortCallback = PSSI_DMAAbort;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Abort DMA TX */
- if (HAL_DMA_Abort_IT(hpssi->hdmatx) != HAL_OK)
- {
- /* Call Directly XferAbortCallback function in case of error */
- hpssi->hdmatx->XferAbortCallback(hpssi->hdmatx);
- }
- }
- }
- /* Abort DMA RX transfer if any */
- else if (hpssi->State == HAL_PSSI_STATE_BUSY_RX)
- {
- /* Set new error code */
- hpssi->ErrorCode |= HAL_PSSI_ERROR_OVER_RUN;
- hpssi->Instance->CR &= ~PSSI_CR_DMAEN;
- if (hpssi->hdmarx != NULL)
- {
- /* Set the PSSI DMA Abort callback :
- will lead to call HAL_PSSI_ErrorCallback() at end of DMA abort procedure */
- hpssi->hdmarx->XferAbortCallback = PSSI_DMAAbort;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Abort DMA RX */
- if (HAL_DMA_Abort_IT(hpssi->hdmarx) != HAL_OK)
- {
- /* Call Directly hpssi->hdma->XferAbortCallback function in case of error */
- hpssi->hdmarx->XferAbortCallback(hpssi->hdmarx);
- }
- }
- }
- else
- {
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- /* Call the corresponding callback to inform upper layer of the error */
- hpssi->ErrorCallback(hpssi);
- #else
- HAL_PSSI_ErrorCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /* If state is an abort treatment on going, don't change state */
- if (hpssi->State == HAL_PSSI_STATE_ABORT)
- {
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- hpssi->AbortCpltCallback(hpssi);
- #else
- HAL_PSSI_AbortCpltCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- else
- {
- /* Set HAL_PSSI_STATE_READY */
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- hpssi->ErrorCallback(hpssi);
- #else
- HAL_PSSI_ErrorCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- }
- /**
- * @brief Tx Transfer complete callback.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- __weak void HAL_PSSI_TxCpltCallback(PSSI_HandleTypeDef *hpssi)
- {
- /* Prevent unused argument(s) compilation warning */
- UNUSED(hpssi);
- /* NOTE : This function should not be modified, when the callback is needed,
- the HAL_PSSI_TxCpltCallback can be implemented in the user file
- */
- }
- /**
- * @brief Rx Transfer complete callback.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- __weak void HAL_PSSI_RxCpltCallback(PSSI_HandleTypeDef *hpssi)
- {
- /* Prevent unused argument(s) compilation warning */
- UNUSED(hpssi);
- /* NOTE : This function should not be modified, when the callback is needed,
- the HAL_PSSI_RxCpltCallback can be implemented in the user file
- */
- }
- /**
- * @brief PSSI error callback.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- __weak void HAL_PSSI_ErrorCallback(PSSI_HandleTypeDef *hpssi)
- {
- /* Prevent unused argument(s) compilation warning */
- UNUSED(hpssi);
- /* NOTE : This function should not be modified, when the callback is needed,
- the HAL_PSSI_ErrorCallback could be implemented in the user file
- */
- }
- /**
- * @brief PSSI abort callback.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval None
- */
- __weak void HAL_PSSI_AbortCpltCallback(PSSI_HandleTypeDef *hpssi)
- {
- /* Prevent unused argument(s) compilation warning */
- UNUSED(hpssi);
- /* NOTE : This function should not be modified, when the callback is needed,
- the HAL_PSSI_AbortCpltCallback could be implemented in the user file
- */
- }
- /**
- * @}
- */
- /** @defgroup PSSI_Exported_Functions_Group3 Peripheral State and Error functions
- * @brief Peripheral State, Mode and Error functions
- *
- @verbatim
- ===============================================================================
- ##### Peripheral State, Mode and Error functions #####
- ===============================================================================
- [..]
- This subsection permit to get in run-time the status of the peripheral
- and the data flow.
- @endverbatim
- * @{
- */
- /**
- * @brief Return the PSSI handle state.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval HAL state
- */
- HAL_PSSI_StateTypeDef HAL_PSSI_GetState(const PSSI_HandleTypeDef *hpssi)
- {
- /* Return PSSI handle state */
- return hpssi->State;
- }
- /**
- * @brief Return the PSSI error code.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @retval PSSI Error Code
- */
- uint32_t HAL_PSSI_GetError(const PSSI_HandleTypeDef *hpssi)
- {
- return hpssi->ErrorCode;
- }
- /**
- * @}
- */
- /**
- * @}
- */
- /** @addtogroup PSSI_Private_Functions
- * @{
- */
- /**
- * @brief PSSI Errors process.
- * @param hpssi PSSI handle.
- * @param ErrorCode Error code to handle.
- * @retval None
- */
- static void PSSI_Error(PSSI_HandleTypeDef *hpssi, uint32_t ErrorCode)
- {
- /* Reset handle parameters */
- hpssi->XferCount = 0U;
- /* Set new error code */
- hpssi->ErrorCode |= ErrorCode;
- /* Disable all interrupts */
- HAL_PSSI_DISABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- #if defined(HAL_DMA_MODULE_ENABLED)
- /* Abort DMA TX transfer if any */
- if ((hpssi->Instance->CR & PSSI_CR_DMAEN) == PSSI_CR_DMAEN)
- {
- if (hpssi->State == HAL_PSSI_STATE_BUSY_TX)
- {
- hpssi->Instance->CR &= ~PSSI_CR_DMAEN;
- if (hpssi->hdmatx != NULL)
- {
- /* Set the PSSI DMA Abort callback :
- will lead to call HAL_PSSI_ErrorCallback() at end of DMA abort procedure */
- hpssi->hdmatx->XferAbortCallback = PSSI_DMAAbort;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Abort DMA TX */
- if (HAL_DMA_Abort_IT(hpssi->hdmatx) != HAL_OK)
- {
- /* Call Directly XferAbortCallback function in case of error */
- hpssi->hdmatx->XferAbortCallback(hpssi->hdmatx);
- }
- }
- }
- /* Abort DMA RX transfer if any */
- else if (hpssi->State == HAL_PSSI_STATE_BUSY_RX)
- {
- hpssi->Instance->CR &= ~PSSI_CR_DMAEN;
- if (hpssi->hdmarx != NULL)
- {
- /* Set the PSSI DMA Abort callback :
- will lead to call HAL_PSSI_ErrorCallback() at end of DMA abort procedure */
- hpssi->hdmarx->XferAbortCallback = PSSI_DMAAbort;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Abort DMA RX */
- if (HAL_DMA_Abort_IT(hpssi->hdmarx) != HAL_OK)
- {
- /* Call Directly hpssi->hdma->XferAbortCallback function in case of error */
- hpssi->hdmarx->XferAbortCallback(hpssi->hdmarx);
- }
- }
- }
- else
- {
- /*Nothing to do*/
- }
- }
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /* If state is an abort treatment on going, don't change state */
- if (hpssi->State == HAL_PSSI_STATE_ABORT)
- {
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->AbortCpltCallback(hpssi);
- #else
- HAL_PSSI_AbortCpltCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- else
- {
- /* Set HAL_PSSI_STATE_READY */
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->ErrorCallback(hpssi);
- #else
- HAL_PSSI_ErrorCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- #if defined(HAL_DMA_MODULE_ENABLED)
- /**
- * @brief DMA PSSI slave transmit process complete callback.
- * @param hdma DMA handle
- * @retval None
- */
- void PSSI_DMATransmitCplt(DMA_HandleTypeDef *hdma)
- {
- /* Derogation MISRAC2012-Rule-11.5 */
- PSSI_HandleTypeDef *hpssi = (PSSI_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent);
- uint32_t tmperror;
- /* Disable Interrupts */
- HAL_PSSI_DISABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- /* Store current volatile hpssi->ErrorCode, misra rule */
- tmperror = hpssi->ErrorCode;
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- if ((hpssi->State == HAL_PSSI_STATE_ABORT) || (tmperror != HAL_PSSI_ERROR_NONE))
- {
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- PSSI_Error(hpssi, hpssi->ErrorCode);
- }
- /* hpssi->State == HAL_PSSI_STATE_BUSY_TX */
- else
- {
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->TxCpltCallback(hpssi);
- #else
- HAL_PSSI_TxCpltCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- /**
- * @brief DMA PSSI master receive process complete callback.
- * @param hdma DMA handle
- * @retval None
- */
- void PSSI_DMAReceiveCplt(DMA_HandleTypeDef *hdma)
- {
- /* Derogation MISRAC2012-Rule-11.5 */
- PSSI_HandleTypeDef *hpssi = (PSSI_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent);
- uint32_t tmperror;
- /* Disable Interrupts */
- HAL_PSSI_DISABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- /* Store current volatile hpssi->ErrorCode, misra rule */
- tmperror = hpssi->ErrorCode;
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- if ((hpssi->State == HAL_PSSI_STATE_ABORT) || (tmperror != HAL_PSSI_ERROR_NONE))
- {
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- PSSI_Error(hpssi, hpssi->ErrorCode);
- }
- /* hpssi->State == HAL_PSSI_STATE_BUSY_RX */
- else
- {
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->RxCpltCallback(hpssi);
- #else
- HAL_PSSI_RxCpltCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- /**
- * @brief DMA PSSI communication abort callback
- * (To be called at end of DMA Abort procedure).
- * @param hdma DMA handle.
- * @retval None
- */
- void PSSI_DMAAbort(DMA_HandleTypeDef *hdma)
- {
- /* Derogation MISRAC2012-Rule-11.5 */
- PSSI_HandleTypeDef *hpssi = (PSSI_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent);
- /* Reset AbortCpltCallback */
- hpssi->hdmatx->XferAbortCallback = NULL;
- hpssi->hdmarx->XferAbortCallback = NULL;
- /* Check if come from abort from user */
- if (hpssi->State == HAL_PSSI_STATE_ABORT)
- {
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->AbortCpltCallback(hpssi);
- #else
- HAL_PSSI_AbortCpltCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- else
- {
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->ErrorCallback(hpssi);
- #else
- HAL_PSSI_ErrorCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /**
- * @brief This function handles PSSI Communication Timeout.
- * @param hpssi Pointer to a PSSI_HandleTypeDef structure that contains
- * the configuration information for the specified PSSI.
- * @param Flag Specifies the PSSI flag to check.
- * @param Status The new Flag status (SET or RESET).
- * @param Timeout Timeout duration
- * @param Tickstart Tick start value
- * @retval HAL status
- */
- static HAL_StatusTypeDef PSSI_WaitOnStatusUntilTimeout(PSSI_HandleTypeDef *hpssi, uint32_t Flag, FlagStatus Status,
- uint32_t Timeout, uint32_t Tickstart)
- {
- while ((HAL_PSSI_GET_STATUS(hpssi, Flag) & Flag) == (uint32_t)Status)
- {
- /* Check for the Timeout */
- if (Timeout != HAL_MAX_DELAY)
- {
- if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U))
- {
- hpssi->ErrorCode |= HAL_PSSI_ERROR_TIMEOUT;
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- return HAL_ERROR;
- }
- }
- }
- return HAL_OK;
- }
- #if defined(HAL_DMA_MODULE_ENABLED)
- void PSSI_DMAError(DMA_HandleTypeDef *hdma)
- {
- /* Derogation MISRAC2012-Rule-11.5 */
- PSSI_HandleTypeDef *hpssi = (PSSI_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent);
- uint32_t tmperror;
- /* Disable the selected PSSI peripheral */
- HAL_PSSI_DISABLE(hpssi);
- /* Disable Interrupts */
- HAL_PSSI_DISABLE_IT(hpssi, PSSI_FLAG_OVR_RIS);
- /* Store current volatile hpssi->ErrorCode, misra rule */
- tmperror = hpssi->ErrorCode;
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- if ((hpssi->State == HAL_PSSI_STATE_ABORT) || (tmperror != HAL_PSSI_ERROR_NONE))
- {
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- PSSI_Error(hpssi, hpssi->ErrorCode);
- }
- else
- {
- hpssi->State = HAL_PSSI_STATE_READY;
- /* Process Unlocked */
- __HAL_UNLOCK(hpssi);
- /* Call the corresponding callback to inform upper layer of End of Transfer */
- #if (USE_HAL_PSSI_REGISTER_CALLBACKS == 1)
- hpssi->ErrorCallback(hpssi);
- #else
- HAL_PSSI_ErrorCallback(hpssi);
- #endif /* USE_HAL_PSSI_REGISTER_CALLBACKS */
- }
- }
- #endif /*HAL_DMA_MODULE_ENABLED*/
- /**
- * @}
- */
- #endif /* PSSI */
- #endif /* HAL_PSSI_MODULE_ENABLED */
- /**
- * @}
- */
- /**
- * @}
- */
|