STM32L486xx HAL User Manual
Functions
IO operation methods
SWPMI Exported Functions

SWPMI Transmit/Receive functions. More...

Functions

HAL_StatusTypeDef HAL_SWPMI_Transmit (SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout)
 Transmit an amount of data in blocking mode.
HAL_StatusTypeDef HAL_SWPMI_Receive (SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size, uint32_t Timeout)
 Receive an amount of data in blocking mode.
HAL_StatusTypeDef HAL_SWPMI_Transmit_IT (SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size)
 Transmit an amount of data in non-blocking mode with interrupt.
HAL_StatusTypeDef HAL_SWPMI_Receive_IT (SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size)
 Receive an amount of data in non-blocking mode with interrupt.
HAL_StatusTypeDef HAL_SWPMI_Transmit_DMA (SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size)
 Transmit an amount of data in non-blocking mode with DMA interrupt.
HAL_StatusTypeDef HAL_SWPMI_Receive_DMA (SWPMI_HandleTypeDef *hswpmi, uint32_t *pData, uint16_t Size)
 Receive an amount of data in non-blocking mode with DMA interrupt.
HAL_StatusTypeDef HAL_SWPMI_DMAStop (SWPMI_HandleTypeDef *hswpmi)
 Stop all DMA transfers.
HAL_StatusTypeDef HAL_SWPMI_EnableLoopback (SWPMI_HandleTypeDef *hswpmi)
 Enable the Loopback mode.
HAL_StatusTypeDef HAL_SWPMI_DisableLoopback (SWPMI_HandleTypeDef *hswpmi)
 Disable the Loopback mode.

Detailed Description

SWPMI Transmit/Receive functions.

 ===============================================================================
                      ##### IO operation methods #####
 ===============================================================================
 [..]
    This subsection provides a set of functions allowing to manage the SWPMI
     data transfers.

    (#) There are two modes of transfer:
       (++) Blocking mode: The communication is performed in polling mode.
            The HAL status of all data processing is returned by the same function
            after finishing transfer.
       (++) Non-Blocking mode: The communication is performed using Interrupts
           or DMA. The end of the data processing will be indicated through the
           dedicated SWPMI Interrupt handler (HAL_SWPMI_IRQHandler()) when using Interrupt mode or
           the selected DMA channel interrupt handler when using DMA mode.
           The HAL_SWPMI_TxCpltCallback(), HAL_SWPMI_RxCpltCallback() user callbacks
           will be executed respectively at the end of the transmit or receive process.
           The HAL_SWPMI_ErrorCallback() user callback will be executed when a communication error is detected.

    (#) Blocking mode API's are:
        (++) HAL_SWPMI_Transmit()
        (++) HAL_SWPMI_Receive()

    (#) Non-Blocking mode API's with Interrupt are:
        (++) HAL_SWPMI_Transmit_IT()
        (++) HAL_SWPMI_Receive_IT()
        (++) HAL_SWPMI_IRQHandler()

    (#) Non-Blocking mode API's with DMA are:
        (++) HAL_SWPMI_Transmit_DMA()
        (++) HAL_SWPMI_Receive_DMA()
        (++) HAL_SWPMI_DMAPause()
        (++) HAL_SWPMI_DMAResume()
        (++) HAL_SWPMI_DMAStop()

    (#) A set of Transfer Complete Callbacks are provided in Non-Blocking mode:
        (++) HAL_SWPMI_TxHalfCpltCallback()
        (++) HAL_SWPMI_TxCpltCallback()
        (++) HAL_SWPMI_RxHalfCpltCallback()
        (++) HAL_SWPMI_RxCpltCallback()
        (++) HAL_SWPMI_ErrorCallback()

    (#) The capability to launch the above IO operations in loopback mode for
        user application verification:
        (++) HAL_SWPMI_EnableLoopback()
        (++) HAL_SWPMI_DisableLoopback()


Function Documentation

HAL_StatusTypeDef HAL_SWPMI_DisableLoopback ( SWPMI_HandleTypeDef hswpmi)

Disable the Loopback mode.

Parameters:
hswpmiSWPMI handle
Note:
Loopback mode is to be used only for test purposes
Return values:
HAL_OK/ HAL_BUSY

Definition at line 1201 of file stm32l4xx_hal_swpmi.c.

References __SWPMI_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_SWPMI_DMAStop ( SWPMI_HandleTypeDef hswpmi)

Stop all DMA transfers.

Parameters:
hswpmiSWPMI handle
Return values:
HAL_OK

Definition at line 1136 of file stm32l4xx_hal_swpmi.c.

References HAL_DMA_Abort(), HAL_SWPMI_STATE_READY, __SWPMI_HandleTypeDef::hdmarx, __SWPMI_HandleTypeDef::hdmatx, __SWPMI_HandleTypeDef::Instance, and __SWPMI_HandleTypeDef::State.

HAL_StatusTypeDef HAL_SWPMI_EnableLoopback ( SWPMI_HandleTypeDef hswpmi)

Enable the Loopback mode.

Parameters:
hswpmiSWPMI handle
Note:
Loopback mode is to be used only for test purposes
Return values:
HAL_OK/ HAL_BUSY

Definition at line 1173 of file stm32l4xx_hal_swpmi.c.

References __SWPMI_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_SWPMI_Receive ( SWPMI_HandleTypeDef hswpmi,
uint32_t *  pData,
uint16_t  Size,
uint32_t  Timeout 
)

Receive an amount of data in blocking mode.

Parameters:
hswpmipointer to a SWPMI_HandleTypeDef structure that contains the configuration information for SWPMI module.
pDataPointer to data buffer
SizeAmount of data to be received
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 766 of file stm32l4xx_hal_swpmi.c.

References HAL_GetTick(), HAL_SWPMI_STATE_BUSY_RX, HAL_SWPMI_STATE_BUSY_TX, HAL_SWPMI_STATE_BUSY_TX_RX, HAL_SWPMI_STATE_READY, __SWPMI_HandleTypeDef::Instance, __SWPMI_HandleTypeDef::State, SWPMI_FLAG_RXBFF, SWPMI_FLAG_RXNE, SWPMI_IT_RIE, SWPMI_IT_RXBERIE, SWPMI_IT_RXBFIE, SWPMI_IT_RXOVRIE, and SWPMI_IT_SRIE.

HAL_StatusTypeDef HAL_SWPMI_Receive_DMA ( SWPMI_HandleTypeDef hswpmi,
uint32_t *  pData,
uint16_t  Size 
)
HAL_StatusTypeDef HAL_SWPMI_Receive_IT ( SWPMI_HandleTypeDef hswpmi,
uint32_t *  pData,
uint16_t  Size 
)
HAL_StatusTypeDef HAL_SWPMI_Transmit ( SWPMI_HandleTypeDef hswpmi,
uint32_t *  pData,
uint16_t  Size,
uint32_t  Timeout 
)

Transmit an amount of data in blocking mode.

Parameters:
hswpmipointer to a SWPMI_HandleTypeDef structure that contains the configuration information for SWPMI module.
pDataPointer to data buffer
SizeAmount of data to be sent
TimeoutTimeout duration
Return values:
HALstatus

Definition at line 662 of file stm32l4xx_hal_swpmi.c.

References __HAL_SWPMI_CLEAR_FLAG, __HAL_SWPMI_DISABLE_IT, __SWPMI_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_SWPMI_ERROR_TXBEF_TIMEOUT, HAL_SWPMI_STATE_BUSY_RX, HAL_SWPMI_STATE_BUSY_TX, HAL_SWPMI_STATE_BUSY_TX_RX, HAL_SWPMI_STATE_READY, __SWPMI_HandleTypeDef::Instance, __SWPMI_HandleTypeDef::State, SWPMI_FLAG_TCF, SWPMI_FLAG_TXBEF, SWPMI_FLAG_TXE, SWPMI_FLAG_TXUNRF, SWPMI_IT_TCIE, SWPMI_IT_TIE, SWPMI_IT_TXBEIE, SWPMI_IT_TXUNRIE, and SWPMI_WaitOnFlagSetUntilTimeout().

HAL_StatusTypeDef HAL_SWPMI_Transmit_DMA ( SWPMI_HandleTypeDef hswpmi,
uint32_t *  pData,
uint16_t  Size 
)
HAL_StatusTypeDef HAL_SWPMI_Transmit_IT ( SWPMI_HandleTypeDef hswpmi,
uint32_t *  pData,
uint16_t  Size 
)

Transmit an amount of data in non-blocking mode with interrupt.

Parameters:
hswpmipointer to a SWPMI_HandleTypeDef structure that contains the configuration information for SWPMI module.
pDataPointer to data buffer
SizeAmount of data to be sent
Return values:
HALstatus

Definition at line 863 of file stm32l4xx_hal_swpmi.c.

References __HAL_SWPMI_ENABLE_IT, __SWPMI_HandleTypeDef::ErrorCode, HAL_SWPMI_ERROR_NONE, HAL_SWPMI_STATE_BUSY_RX, HAL_SWPMI_STATE_BUSY_TX, HAL_SWPMI_STATE_BUSY_TX_RX, HAL_SWPMI_STATE_READY, __SWPMI_HandleTypeDef::Instance, __SWPMI_HandleTypeDef::pTxBuffPtr, __SWPMI_HandleTypeDef::State, SWPMI_IT_TCIE, SWPMI_IT_TIE, SWPMI_IT_TXBEIE, SWPMI_IT_TXUNRIE, __SWPMI_HandleTypeDef::TxXferCount, and __SWPMI_HandleTypeDef::TxXferSize.