STM32H735xx HAL User Manual
Functions
stm32h7xx_hal_pssi.c File Reference

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. More...

#include "stm32h7xx_hal.h"

Go to the source code of this file.

Functions

void PSSI_DMATransmitCplt (DMA_HandleTypeDef *hdma)
 DMA PSSI slave transmit process complete callback.
void PSSI_DMAReceiveCplt (DMA_HandleTypeDef *hdma)
 DMA PSSI master receive process complete callback.
void PSSI_DMAError (DMA_HandleTypeDef *hdma)
void PSSI_DMAAbort (DMA_HandleTypeDef *hdma)
 DMA PSSI communication abort callback (To be called at end of DMA Abort procedure).
static void PSSI_Error (PSSI_HandleTypeDef *hpssi, uint32_t ErrorCode)
 PSSI Errors process.
static HAL_StatusTypeDef PSSI_WaitOnStatusUntilTimeout (PSSI_HandleTypeDef *hpssi, uint32_t Flag, FlagStatus Status, uint32_t Timeout, uint32_t Tickstart)
 This function handles PSSI Communication Timeout.
HAL_StatusTypeDef HAL_PSSI_Init (PSSI_HandleTypeDef *hpssi)
 Initializes the PSSI according to the specified parameters in the PSSI_InitTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_PSSI_DeInit (PSSI_HandleTypeDef *hpssi)
 DeInitialize the PSSI peripheral.
__weak void HAL_PSSI_MspInit (PSSI_HandleTypeDef *hpssi)
 Initialize the PSSI MSP.
__weak void HAL_PSSI_MspDeInit (PSSI_HandleTypeDef *hpssi)
 DeInitialize the PSSI MSP.
HAL_StatusTypeDef HAL_PSSI_RegisterCallback (PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID, pPSSI_CallbackTypeDef pCallback)
 Register a User PSSI Callback To be used instead of the weak predefined callback.
HAL_StatusTypeDef HAL_PSSI_UnRegisterCallback (PSSI_HandleTypeDef *hpssi, HAL_PSSI_CallbackIDTypeDef CallbackID)
 Unregister an PSSI Callback PSSI callback is redirected to the weak predefined callback.
HAL_StatusTypeDef HAL_PSSI_Transmit (PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout)
 Transmits in master mode an amount of data in blocking mode.
HAL_StatusTypeDef HAL_PSSI_Receive (PSSI_HandleTypeDef *hpssi, uint8_t *pData, uint32_t Size, uint32_t Timeout)
 Receives an amount of data in blocking mode.
HAL_StatusTypeDef HAL_PSSI_Transmit_DMA (PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size)
 Transmit an amount of data in non-blocking mode with DMA.
HAL_StatusTypeDef HAL_PSSI_Receive_DMA (PSSI_HandleTypeDef *hpssi, uint32_t *pData, uint32_t Size)
 Receive an amount of data in non-blocking mode with DMA.
HAL_StatusTypeDef HAL_PSSI_Abort_DMA (PSSI_HandleTypeDef *hpssi)
 Abort a DMA process communication with Interrupt.
void HAL_PSSI_IRQHandler (PSSI_HandleTypeDef *hpssi)
 This function handles PSSI event interrupt request.
__weak void HAL_PSSI_TxCpltCallback (PSSI_HandleTypeDef *hpssi)
 Tx Transfer complete callback.
__weak void HAL_PSSI_RxCpltCallback (PSSI_HandleTypeDef *hpssi)
 Rx Transfer complete callback.
__weak void HAL_PSSI_ErrorCallback (PSSI_HandleTypeDef *hpssi)
 PSSI error callback.
__weak void HAL_PSSI_AbortCpltCallback (PSSI_HandleTypeDef *hpssi)
 PSSI abort callback.
HAL_PSSI_StateTypeDef HAL_PSSI_GetState (PSSI_HandleTypeDef *hpssi)
 Return the PSSI handle state.
uint32_t HAL_PSSI_GetError (PSSI_HandleTypeDef *hpssi)
 Return the PSSI error code.

Detailed Description

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.

Author:
MCD Application Team
Attention:

Copyright (c) 2017 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.

  ==============================================================================
                        ##### 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 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 HAL_PSSI_Init(), configure also the low level Hardware
        (GPIO, CLOCK, NVIC...etc) by calling the customized 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 HAL_PSSI_Transmit()
      (+) Receive an amount of data by byte in blocking mode using HAL_PSSI_Receive()

    *** DMA mode IO operation ***
    ==============================
    [..]
      (+) Transmit an amount of data in non-blocking mode (DMA) using
          HAL_PSSI_Transmit_DMA()
      (+) At transmission end of transfer, HAL_PSSI_TxCpltCallback() is executed and user can
           add his own code by customization of function pointer HAL_PSSI_TxCpltCallback()
      (+) Receive an amount of data in non-blocking mode (DMA) using
          HAL_PSSI_Receive_DMA()
      (+) At reception end of transfer, HAL_PSSI_RxCpltCallback() is executed and user can
           add his own code by customization of function pointer HAL_PSSI_RxCpltCallback()
      (+) In case of transfer Error, HAL_PSSI_ErrorCallback() function is executed and user can
           add his own code by customization of function pointer HAL_PSSI_ErrorCallback()
      (+) Abort a  PSSI process communication with Interrupt using HAL_PSSI_Abort_IT()
      (+) End of abort process, HAL_PSSI_AbortCpltCallback() is executed and user can
           add his own code by customization of function pointer HAL_PSSI_AbortCpltCallback()

     *** PSSI HAL driver macros list ***
     ==================================
     [..]
       Below the list of most used macros in PSSI HAL driver.

      (+) HAL_PSSI_ENABLE     : Enable the PSSI peripheral
      (+) HAL_PSSI_DISABLE    : Disable the PSSI peripheral
      (+) HAL_PSSI_GET_FLAG   : Check whether the specified PSSI flag is set or not
      (+) HAL_PSSI_CLEAR_FLAG : Clear the specified PSSI pending flag
      (+) HAL_PSSI_ENABLE_IT  : Enable the specified PSSI interrupt
      (+) HAL_PSSI_DISABLE_IT : Disable the specified PSSI interrupt

     *** Callback registration ***
     =============================================
     Use Functions HAL_PSSI_RegisterCallback() or HAL_PSSI_RegisterAddrCallback()
     to register an interrupt callback.

     Function 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 HAL_PSSI_UnRegisterCallback to reset a callback to the default
     weak function.
     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 HAL_PSSI_Init() and when the state is HAL_PSSI_STATE_RESET
     all callbacks are set to the corresponding weak functions:
     examples HAL_PSSI_TxCpltCallback(), HAL_PSSI_RxCpltCallback().
     Exception done for MspInit and MspDeInit functions that are
     reset to the legacy weak functions in the HAL_PSSI_Init()/ HAL_PSSI_DeInit() only when
     these callbacks are null (not registered beforehand).
     If MspInit or MspDeInit are not null, the HAL_PSSI_Init()/ HAL_PSSI_DeInit()
     keep and use the user MspInit/MspDeInit callbacks (registered beforehand) whatever the state.

     Callbacks can be registered/unregistered in HAL_PSSI_STATE_READY state only.
     Exception done MspInit/MspDeInit functions that can be registered/unregistered
     in HAL_PSSI_STATE_READY or 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 HAL_PSSI_RegisterCallback() before calling HAL_PSSI_DeInit()
     or HAL_PSSI_Init() function.


     [..]
       (@) You can refer to the PSSI HAL driver header file for more useful macros

  

Definition in file stm32h7xx_hal_pssi.c.