+++ /dev/null
-/**\r
- ******************************************************************************\r
- * @file stm32f7xx_hal_smartcard_ex.c\r
- * @author MCD Application Team\r
- * @version V0.3.0\r
- * @date 06-March-2015\r
- * @brief SMARTCARD HAL module driver.\r
- *\r
- * This file provides extended firmware functions to manage the following \r
- * functionalities of the SmartCard.\r
- * + Initialization and de-initialization functions\r
- * + Peripheral Control functions\r
- @verbatim\r
- ===============================================================================\r
- ##### How to use this driver #####\r
- ===============================================================================\r
- [..]\r
- The Extended SMARTCARD HAL driver can be used as follow:\r
-\r
- (#) After having configured the SMARTCARD basic features with HAL_SMARTCARD_Init(), \r
- then if required, program SMARTCARD advanced features (TX/RX pins swap, TimeOut, \r
- auto-retry counter,...) in the hsc AdvancedInit structure.\r
-\r
- @endverbatim\r
- ******************************************************************************\r
- * @attention\r
- *\r
- * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>\r
- *\r
- * Redistribution and use in source and binary forms, with or without modification,\r
- * are permitted provided that the following conditions are met:\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- * 3. Neither the name of STMicroelectronics nor the names of its contributors\r
- * may be used to endorse or promote products derived from this software\r
- * without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- *\r
- ******************************************************************************\r
- */\r
-\r
-/* Includes ------------------------------------------------------------------*/\r
-#include "stm32f7xx_hal.h"\r
-\r
-/** @addtogroup STM32F7xx_HAL_Driver\r
- * @{\r
- */\r
-\r
-/** @defgroup SMARTCARDEx SMARTCARDEx\r
- * @brief SMARTCARD Extended HAL module driver\r
- * @{\r
- */\r
-#ifdef HAL_SMARTCARD_MODULE_ENABLED\r
- \r
-/* Private typedef -----------------------------------------------------------*/\r
-/* Private define ------------------------------------------------------------*/\r
-/* Private macro -------------------------------------------------------------*/\r
-/* Private variables ---------------------------------------------------------*/\r
-/* Private function prototypes -----------------------------------------------*/\r
-/* Private functions ---------------------------------------------------------*/\r
-\r
-/** @defgroup SMARTCARDEx_Private_Functions\r
- * @{\r
- */\r
-\r
-/** @defgroup SMARTCARDEx_Group1 Extended Peripheral Control functions\r
- * @brief Extended control functions\r
- *\r
-@verbatim \r
- ===============================================================================\r
- ##### Peripheral Control functions #####\r
- ===============================================================================\r
- [..]\r
- This subsection provides a set of functions allowing to initialize the SMARTCARD.\r
- (+) HAL_SMARTCARDEx_BlockLength_Config() API allows to configure the Block Length on the fly \r
- (+) HAL_SMARTCARDEx_TimeOut_Config() API allows to configure the receiver timeout value on the fly \r
- (+) HAL_SMARTCARDEx_EnableReceiverTimeOut() API enables the receiver timeout feature\r
- (+) HAL_SMARTCARDEx_DisableReceiverTimeOut() API disables the receiver timeout feature\r
-\r
-@endverbatim\r
- * @{\r
- */\r
-\r
-/**\r
- * @brief Update on the fly the SMARTCARD block length in RTOR register\r
- * @param hsc: SMARTCARD handle\r
- * @param BlockLength: SMARTCARD block length (8-bit long at most) \r
- * @retval None\r
- */\r
-void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsc, uint8_t BlockLength)\r
-{\r
- MODIFY_REG(hsc->Instance->RTOR, USART_RTOR_BLEN, ((uint32_t)BlockLength << SMARTCARD_RTOR_BLEN_LSB_POS));\r
-}\r
-\r
-/**\r
- * @brief Update on the fly the receiver timeout value in RTOR register\r
- * @param hsc: SMARTCARD handle\r
- * @param TimeOutValue: receiver timeout value in number of baud blocks. The timeout\r
- * value must be less or equal to 0x0FFFFFFFF. \r
- * @retval None\r
- */\r
-void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsc, uint32_t TimeOutValue)\r
-{\r
- assert_param(IS_SMARTCARD_TIMEOUT_VALUE(hsc->Init.TimeOutValue));\r
- MODIFY_REG(hsc->Instance->RTOR, USART_RTOR_RTO, TimeOutValue); \r
-}\r
-\r
-/**\r
- * @brief Enable the SMARTCARD receiver timeout feature\r
- * @param hsc: SMARTCARD handle\r
- * @retval HAL status\r
- */\r
-HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc)\r
-{\r
- /* Process Locked */\r
- __HAL_LOCK(hsc);\r
-\r
- hsc->State = HAL_SMARTCARD_STATE_BUSY;\r
-\r
- /* Set the USART RTOEN bit */\r
- hsc->Instance->CR2 |= USART_CR2_RTOEN;\r
-\r
- hsc->State = HAL_SMARTCARD_STATE_READY;\r
-\r
- /* Process Unlocked */\r
- __HAL_UNLOCK(hsc);\r
-\r
- return HAL_OK;\r
-}\r
-\r
-/**\r
- * @brief Disable the SMARTCARD receiver timeout feature\r
- * @param hsc: SMARTCARD handle\r
- * @retval HAL status\r
- */\r
-HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc)\r
-{\r
- /* Process Locked */\r
- __HAL_LOCK(hsc);\r
-\r
- hsc->State = HAL_SMARTCARD_STATE_BUSY;\r
-\r
- /* Clear the USART RTOEN bit */\r
- hsc->Instance->CR2 &= ~(USART_CR2_RTOEN);\r
-\r
- hsc->State = HAL_SMARTCARD_STATE_READY;\r
-\r
- /* Process Unlocked */\r
- __HAL_UNLOCK(hsc);\r
-\r
- return HAL_OK;\r
-}\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-#endif /* HAL_SMARTCARD_MODULE_ENABLED */\r
-/**\r
- * @}\r
- */\r
-\r
-/**\r
- * @}\r
- */\r
-\r
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r