L4 HAL Drivers

Embed: (wiki syntax)

« Back to documentation index

stm32l4xx_hal_swpmi.c File Reference

stm32l4xx_hal_swpmi.c File Reference

SWPMI HAL module driver. This file provides firmware functions to manage the following functionalities of the Single Wire Protocol Master Interface (SWPMI). + Initialization and Configuration + Data transfers functions + DMA transfers management + Interrupts and flags management. More...

Go to the source code of this file.

Functions

static void SWPMI_DMATransmitCplt (DMA_HandleTypeDef *hdma)
 DMA SWPMI transmit process complete callback.
static void SWPMI_DMATxHalfCplt (DMA_HandleTypeDef *hdma)
 DMA SWPMI transmit process half complete callback.
static void SWPMI_DMAReceiveCplt (DMA_HandleTypeDef *hdma)
 DMA SWPMI receive process complete callback.
static void SWPMI_DMARxHalfCplt (DMA_HandleTypeDef *hdma)
 DMA SWPMI receive process half complete callback.
static void SWPMI_DMAError (DMA_HandleTypeDef *hdma)
 DMA SWPMI communication error callback.
static HAL_StatusTypeDef SWPMI_Transmit_IT (SWPMI_HandleTypeDef *hswpmi)
 Transmit an amount of data in interrupt mode.
static HAL_StatusTypeDef SWPMI_EndTransmit_IT (SWPMI_HandleTypeDef *hswpmi)
 Wraps up transmission in non-blocking mode.
static HAL_StatusTypeDef SWPMI_Receive_IT (SWPMI_HandleTypeDef *hswpmi)
 Receive an amount of data in interrupt mode.
static HAL_StatusTypeDef SWPMI_EndReceive_IT (SWPMI_HandleTypeDef *hswpmi)
 Wraps up reception in non-blocking mode.
static HAL_StatusTypeDef SWPMI_EndTransmitReceive_IT (SWPMI_HandleTypeDef *hswpmi)
 Wraps up transmission and reception in non-blocking mode.
static HAL_StatusTypeDef SWPMI_WaitOnFlagSetUntilTimeout (SWPMI_HandleTypeDef *hswpmi, uint32_t Flag, uint32_t Timeout)
 Handle SWPMI Communication Timeout.
HAL_StatusTypeDef HAL_SWPMI_Init (SWPMI_HandleTypeDef *hswpmi)
 Initialize the SWPMI peripheral according to the specified parameters in the SWPMI_InitTypeDef.
HAL_StatusTypeDef HAL_SWPMI_DeInit (SWPMI_HandleTypeDef *hswpmi)
 De-initialize the SWPMI peripheral.
__weak void HAL_SWPMI_MspInit (SWPMI_HandleTypeDef *hswpmi)
 Initialize the SWPMI MSP.
__weak void HAL_SWPMI_MspDeInit (SWPMI_HandleTypeDef *hswpmi)
 DeInitialize the SWPMI MSP.
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.
void HAL_SWPMI_IRQHandler (SWPMI_HandleTypeDef *hswpmi)
 Handle SWPMI interrupt request.
__weak void HAL_SWPMI_TxCpltCallback (SWPMI_HandleTypeDef *hswpmi)
 Tx Transfer completed callback.
__weak void HAL_SWPMI_TxHalfCpltCallback (SWPMI_HandleTypeDef *hswpmi)
 Tx Half Transfer completed callback.
__weak void HAL_SWPMI_RxCpltCallback (SWPMI_HandleTypeDef *hswpmi)
 Rx Transfer completed callback.
__weak void HAL_SWPMI_RxHalfCpltCallback (SWPMI_HandleTypeDef *hswpmi)
 Rx Half Transfer completed callback.
__weak void HAL_SWPMI_ErrorCallback (SWPMI_HandleTypeDef *hswpmi)
 SWPMI error callback.
HAL_SWPMI_StateTypeDef HAL_SWPMI_GetState (SWPMI_HandleTypeDef *hswpmi)
 Return the SWPMI handle state.
uint32_t HAL_SWPMI_GetError (SWPMI_HandleTypeDef *hswpmi)
 Return the SWPMI error code.

Detailed Description

SWPMI HAL module driver. This file provides firmware functions to manage the following functionalities of the Single Wire Protocol Master Interface (SWPMI). + Initialization and Configuration + Data transfers functions + DMA transfers management + Interrupts and flags management.

Author:
MCD Application Team
Version:
V1.1.0
Date:
16-September-2015
 ===============================================================================
                        ##### How to use this driver #####
 ===============================================================================
  [..]
     The SWPMI HAL driver can be used as follows:

    (#) Declare a SWPMI_HandleTypeDef handle structure (eg. SWPMI_HandleTypeDef hswpmi).

    (#) Initialize the SWPMI low level resources by implementing the HAL_SWPMI_MspInit() API:
        (##) Enable the SWPMIx interface clock with __HAL_RCC_SWPMIx_CLK_ENABLE().
        (##) SWPMI IO configuration:
            (+++) Enable the clock for the SWPMI GPIO.
            (+++) Configure these SWPMI pins as alternate function pull-up.
        (##) NVIC configuration if you need to use interrupt process (HAL_SWPMI_Transmit_IT()
             and HAL_SWPMI_Receive_IT() APIs):
            (+++) Configure the SWPMIx interrupt priority with HAL_NVIC_SetPriority().
            (+++) Enable the NVIC SWPMI IRQ handle with HAL_NVIC_EnableIRQ().

        (##) DMA Configuration if you need to use DMA process (HAL_SWPMI_Transmit_DMA()
             and HAL_SWPMI_Receive_DMA() APIs):
            (+++) Declare a DMA handle structure for the Tx/Rx channels.
            (+++) Enable the DMAx interface clock.
            (+++) Configure the declared DMA handle structure with the required
                  Tx/Rx parameters.
            (+++) Configure the DMA Tx/Rx channels and requests.
            (+++) Associate the initialized DMA handle to the SWPMI DMA Tx/Rx handle.
            (+++) Configure the priority and enable the NVIC for the transfer complete
                  interrupt on the DMA Tx/Rx channels.

    (#) Program the Bite Rate, Tx Buffering mode, Rx Buffering mode in the Init structure.

    (#) Enable the SWPMI peripheral by calling the HAL_SWPMI_Init() function.
    
  
Attention:

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32l4xx_hal_swpmi.c.