STM32L4xx_HAL_Driver  1.14.0

Extended control functions. More...

Functions

void HAL_SMARTCARDEx_BlockLength_Config (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t BlockLength)
 Update on the fly the SMARTCARD block length in RTOR register. More...
 
void HAL_SMARTCARDEx_TimeOut_Config (SMARTCARD_HandleTypeDef *hsmartcard, uint32_t TimeOutValue)
 Update on the fly the receiver timeout value in RTOR register. More...
 
HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut (SMARTCARD_HandleTypeDef *hsmartcard)
 Enable the SMARTCARD receiver timeout feature. More...
 
HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut (SMARTCARD_HandleTypeDef *hsmartcard)
 Disable the SMARTCARD receiver timeout feature. More...
 

Detailed Description

Extended control functions.

  ===============================================================================
                      ##### Peripheral Control functions #####
  ===============================================================================
  [..]
  This subsection provides a set of functions allowing to initialize the SMARTCARD.
     (+) HAL_SMARTCARDEx_BlockLength_Config() API allows to configure the Block Length on the fly
     (+) HAL_SMARTCARDEx_TimeOut_Config() API allows to configure the receiver timeout value on the fly
     (+) HAL_SMARTCARDEx_EnableReceiverTimeOut() API enables the receiver timeout feature
     (+) HAL_SMARTCARDEx_DisableReceiverTimeOut() API disables the receiver timeout feature

Function Documentation

◆ HAL_SMARTCARDEx_BlockLength_Config()

void HAL_SMARTCARDEx_BlockLength_Config ( SMARTCARD_HandleTypeDef hsmartcard,
uint8_t  BlockLength 
)

Update on the fly the SMARTCARD block length in RTOR register.

Parameters
hsmartcardPointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module.
BlockLengthSMARTCARD block length (8-bit long at most)
Return values
None

Definition at line 100 of file stm32l4xx_hal_smartcard_ex.c.

101 {
102  MODIFY_REG(hsmartcard->Instance->RTOR, USART_RTOR_BLEN, ((uint32_t)BlockLength << USART_RTOR_BLEN_Pos));
103 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ HAL_SMARTCARDEx_DisableReceiverTimeOut()

HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut ( SMARTCARD_HandleTypeDef hsmartcard)

Disable the SMARTCARD receiver timeout feature.

Parameters
hsmartcardPointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module.
Return values
HALstatus

Definition at line 153 of file stm32l4xx_hal_smartcard_ex.c.

154 {
155  if (hsmartcard->gState == HAL_SMARTCARD_STATE_READY)
156  {
157  /* Process Locked */
158  __HAL_LOCK(hsmartcard);
159 
160  hsmartcard->gState = HAL_SMARTCARD_STATE_BUSY;
161 
162  /* Clear the USART RTOEN bit */
163  CLEAR_BIT(hsmartcard->Instance->CR2, USART_CR2_RTOEN);
164 
165  hsmartcard->gState = HAL_SMARTCARD_STATE_READY;
166 
167  /* Process Unlocked */
168  __HAL_UNLOCK(hsmartcard);
169 
170  return HAL_OK;
171  }
172  else
173  {
174  return HAL_BUSY;
175  }
176 }
__IO HAL_SMARTCARD_StateTypeDef gState
__HAL_UNLOCK(hrtc)
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
__HAL_LOCK(hrtc)
return HAL_OK

◆ HAL_SMARTCARDEx_EnableReceiverTimeOut()

HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut ( SMARTCARD_HandleTypeDef hsmartcard)

Enable the SMARTCARD receiver timeout feature.

Parameters
hsmartcardPointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module.
Return values
HALstatus

Definition at line 123 of file stm32l4xx_hal_smartcard_ex.c.

124 {
125  if (hsmartcard->gState == HAL_SMARTCARD_STATE_READY)
126  {
127  /* Process Locked */
128  __HAL_LOCK(hsmartcard);
129 
130  hsmartcard->gState = HAL_SMARTCARD_STATE_BUSY;
131 
132  /* Set the USART RTOEN bit */
133  SET_BIT(hsmartcard->Instance->CR2, USART_CR2_RTOEN);
134 
135  hsmartcard->gState = HAL_SMARTCARD_STATE_READY;
136 
137  /* Process Unlocked */
138  __HAL_UNLOCK(hsmartcard);
139 
140  return HAL_OK;
141  }
142  else
143  {
144  return HAL_BUSY;
145  }
146 }
__IO HAL_SMARTCARD_StateTypeDef gState
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK

◆ HAL_SMARTCARDEx_TimeOut_Config()

void HAL_SMARTCARDEx_TimeOut_Config ( SMARTCARD_HandleTypeDef hsmartcard,
uint32_t  TimeOutValue 
)

Update on the fly the receiver timeout value in RTOR register.

Parameters
hsmartcardPointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module.
TimeOutValuereceiver timeout value in number of baud blocks. The timeout value must be less or equal to 0x0FFFFFFFF.
Return values
None

Definition at line 112 of file stm32l4xx_hal_smartcard_ex.c.

113 {
114  assert_param(IS_SMARTCARD_TIMEOUT_VALUE(hsmartcard->Init.TimeOutValue));
115  MODIFY_REG(hsmartcard->Instance->RTOR, USART_RTOR_RTO, TimeOutValue);
116 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))