STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_smartcard_ex.c
Go to the documentation of this file.
1 
55 /* Includes ------------------------------------------------------------------*/
56 #include "stm32f7xx_hal.h"
57 
66 #ifdef HAL_SMARTCARD_MODULE_ENABLED
67 
68 /* Private typedef -----------------------------------------------------------*/
69 /* Private define ------------------------------------------------------------*/
70 /* Private macro -------------------------------------------------------------*/
71 /* Private variables ---------------------------------------------------------*/
72 /* Private function prototypes -----------------------------------------------*/
73 /* Private functions ---------------------------------------------------------*/
74 
103 void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsc, uint8_t BlockLength)
104 {
105  MODIFY_REG(hsc->Instance->RTOR, USART_RTOR_BLEN, ((uint32_t)BlockLength << SMARTCARD_RTOR_BLEN_LSB_POS));
106 }
107 
115 void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsc, uint32_t TimeOutValue)
116 {
118  MODIFY_REG(hsc->Instance->RTOR, USART_RTOR_RTO, TimeOutValue);
119 }
120 
127 {
128  /* Process Locked */
129  __HAL_LOCK(hsc);
130 
132 
133  /* Set the USART RTOEN bit */
134  hsc->Instance->CR2 |= USART_CR2_RTOEN;
135 
137 
138  /* Process Unlocked */
139  __HAL_UNLOCK(hsc);
140 
141  return HAL_OK;
142 }
143 
150 {
151  /* Process Locked */
152  __HAL_LOCK(hsc);
153 
155 
156  /* Clear the USART RTOEN bit */
157  hsc->Instance->CR2 &= ~(USART_CR2_RTOEN);
158 
160 
161  /* Process Unlocked */
162  __HAL_UNLOCK(hsc);
163 
164  return HAL_OK;
165 }
166 
175 #endif /* HAL_SMARTCARD_MODULE_ENABLED */
176 
184 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f7xx.h:190
#define assert_param(expr)
Include module&#39;s header file.
#define USART_RTOR_RTO
Definition: stm32f745xx.h:7496
HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc)
#define __HAL_UNLOCK(__HANDLE__)
void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsc, uint8_t BlockLength)
#define IS_SMARTCARD_TIMEOUT_VALUE(__TIMEOUTVALUE__)
#define USART_RTOR_BLEN
Definition: stm32f745xx.h:7497
#define __HAL_LOCK(__HANDLE__)
This file contains all the functions prototypes for the HAL module driver.
#define USART_CR2_RTOEN
Definition: stm32f745xx.h:7460
SMARTCARD handle Structure definition.
HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc)
__IO uint32_t RTOR
Definition: stm32f745xx.h:935
__IO uint32_t CR2
Definition: stm32f745xx.h:931
#define SMARTCARD_RTOR_BLEN_LSB_POS
__IO HAL_SMARTCARD_StateTypeDef gState
HAL_StatusTypeDef
HAL Status structures definition.
void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsc, uint32_t TimeOutValue)