stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart_ex.c
Go to the documentation of this file.
1 
43 /* Includes ------------------------------------------------------------------*/
44 #include "stm32h7xx_hal.h"
45 
55 #ifdef HAL_UART_MODULE_ENABLED
56 
57 /* Private typedef -----------------------------------------------------------*/
58 /* Private define ------------------------------------------------------------*/
62 /* UART RX FIFO depth */
63 #define RX_FIFO_DEPTH 16U
64 
65 /* UART TX FIFO depth */
66 #define TX_FIFO_DEPTH 16U
67 
71 /* Private macros ------------------------------------------------------------*/
72 /* Private variables ---------------------------------------------------------*/
73 /* Private function prototypes -----------------------------------------------*/
77 static void UARTEx_Wakeup_AddressConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection);
78 static void UARTEx_SetNbDataToProcess(UART_HandleTypeDef *huart);
83 /* Exported functions --------------------------------------------------------*/
84 
166 HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime,
167  uint32_t DeassertionTime)
168 {
169  uint32_t temp;
170 
171  /* Check the UART handle allocation */
172  if (huart == NULL)
173  {
174  return HAL_ERROR;
175  }
176  /* Check the Driver Enable UART instance */
178 
179  /* Check the Driver Enable polarity */
181 
182  /* Check the Driver Enable assertion time */
183  assert_param(IS_UART_ASSERTIONTIME(AssertionTime));
184 
185  /* Check the Driver Enable deassertion time */
186  assert_param(IS_UART_DEASSERTIONTIME(DeassertionTime));
187 
189  {
190  /* Allocate lock resource and initialize it */
192 
193 #if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
194  UART_InitCallbacksToDefault(huart);
195 
196  if (huart->MspInitCallback == NULL)
197  {
198  huart->MspInitCallback = HAL_UART_MspInit;
199  }
200 
201  /* Init the low level hardware */
202  huart->MspInitCallback(huart);
203 #else
204  /* Init the low level hardware : GPIO, CLOCK, CORTEX */
206 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */
207  }
208 
210 
211  /* Disable the Peripheral */
213 
214  /* Set the UART Communication parameters */
216  {
217  return HAL_ERROR;
218  }
219 
221  {
223  }
224 
225  /* Enable the Driver Enable mode by setting the DEM bit in the CR3 register */
227 
228  /* Set the Driver Enable polarity */
229  MODIFY_REG(huart->Instance->CR3, USART_CR3_DEP, Polarity);
230 
231  /* Set the Driver Enable assertion and deassertion times */
232  temp = (AssertionTime << UART_CR1_DEAT_ADDRESS_LSB_POS);
233  temp |= (DeassertionTime << UART_CR1_DEDT_ADDRESS_LSB_POS);
235 
236  /* Enable the Peripheral */
238 
239  /* TEACK and/or REACK to check before moving huart->gState and huart->RxState to Ready */
240  return (UART_CheckIdleState(huart));
241 }
242 
273 {
274  /* Prevent unused argument(s) compilation warning */
275  UNUSED(huart);
276 
277  /* NOTE : This function should not be modified, when the callback is needed,
278  the HAL_UARTEx_WakeupCallback can be implemented in the user file.
279  */
280 }
281 
288 {
289  /* Prevent unused argument(s) compilation warning */
290  UNUSED(huart);
291 
292  /* NOTE : This function should not be modified, when the callback is needed,
293  the HAL_UARTEx_RxFifoFullCallback can be implemented in the user file.
294  */
295 }
296 
303 {
304  /* Prevent unused argument(s) compilation warning */
305  UNUSED(huart);
306 
307  /* NOTE : This function should not be modified, when the callback is needed,
308  the HAL_UARTEx_TxFifoEmptyCallback can be implemented in the user file.
309  */
310 }
311 
388 {
389  /* Check the UART handle allocation */
390  if (huart == NULL)
391  {
392  return HAL_ERROR;
393  }
394 
395  /* Check the address length parameter */
397 
399 
400  /* Disable the Peripheral */
402 
403  /* Set the address length */
404  MODIFY_REG(huart->Instance->CR2, USART_CR2_ADDM7, AddressLength);
405 
406  /* Enable the Peripheral */
408 
409  /* TEACK and/or REACK to check before moving huart->gState to Ready */
410  return (UART_CheckIdleState(huart));
411 }
412 
426 {
427  HAL_StatusTypeDef status = HAL_OK;
428  uint32_t tickstart;
429 
430  /* check the wake-up from stop mode UART instance */
432  /* check the wake-up selection parameter */
434 
435  /* Process Locked */
436  __HAL_LOCK(huart);
437 
439 
440  /* Disable the Peripheral */
442 
443  /* Set the wake-up selection scheme */
444  MODIFY_REG(huart->Instance->CR3, USART_CR3_WUS, WakeUpSelection.WakeUpEvent);
445 
446  if (WakeUpSelection.WakeUpEvent == UART_WAKEUP_ON_ADDRESS)
447  {
448  UARTEx_Wakeup_AddressConfig(huart, WakeUpSelection);
449  }
450 
451  /* Enable the Peripheral */
453 
454  /* Init tickstart for timeout management */
455  tickstart = HAL_GetTick();
456 
457  /* Wait until REACK flag is set */
459  {
460  status = HAL_TIMEOUT;
461  }
462  else
463  {
464  /* Initialize the UART State */
466  }
467 
468  /* Process Unlocked */
470 
471  return status;
472 }
473 
481 {
482  /* Process Locked */
483  __HAL_LOCK(huart);
484 
485  /* Set UESM bit */
487 
488  /* Process Unlocked */
490 
491  return HAL_OK;
492 }
493 
500 {
501  /* Process Locked */
502  __HAL_LOCK(huart);
503 
504  /* Clear UESM bit */
506 
507  /* Process Unlocked */
509 
510  return HAL_OK;
511 }
512 
519 {
520  uint32_t tmpcr1;
521 
522  /* Check parameters */
524 
525  /* Process Locked */
526  __HAL_LOCK(huart);
527 
529 
530  /* Save actual UART configuration */
531  tmpcr1 = READ_REG(huart->Instance->CR1);
532 
533  /* Disable UART */
535 
536  /* Enable FIFO mode */
537  SET_BIT(tmpcr1, USART_CR1_FIFOEN);
539 
540  /* Restore UART configuration */
541  WRITE_REG(huart->Instance->CR1, tmpcr1);
542 
543  /* Determine the number of data to process during RX/TX ISR execution */
544  UARTEx_SetNbDataToProcess(huart);
545 
547 
548  /* Process Unlocked */
550 
551  return HAL_OK;
552 }
553 
560 {
561  uint32_t tmpcr1;
562 
563  /* Check parameters */
565 
566  /* Process Locked */
567  __HAL_LOCK(huart);
568 
570 
571  /* Save actual UART configuration */
572  tmpcr1 = READ_REG(huart->Instance->CR1);
573 
574  /* Disable UART */
576 
577  /* Enable FIFO mode */
578  CLEAR_BIT(tmpcr1, USART_CR1_FIFOEN);
580 
581  /* Restore UART configuration */
582  WRITE_REG(huart->Instance->CR1, tmpcr1);
583 
585 
586  /* Process Unlocked */
588 
589  return HAL_OK;
590 }
591 
606 {
607  uint32_t tmpcr1;
608 
609  /* Check parameters */
612 
613  /* Process Locked */
614  __HAL_LOCK(huart);
615 
617 
618  /* Save actual UART configuration */
619  tmpcr1 = READ_REG(huart->Instance->CR1);
620 
621  /* Disable UART */
623 
624  /* Update TX threshold configuration */
626 
627  /* Determine the number of data to process during RX/TX ISR execution */
628  UARTEx_SetNbDataToProcess(huart);
629 
630  /* Restore UART configuration */
631  WRITE_REG(huart->Instance->CR1, tmpcr1);
632 
634 
635  /* Process Unlocked */
637 
638  return HAL_OK;
639 }
640 
655 {
656  uint32_t tmpcr1;
657 
658  /* Check the parameters */
661 
662  /* Process Locked */
663  __HAL_LOCK(huart);
664 
666 
667  /* Save actual UART configuration */
668  tmpcr1 = READ_REG(huart->Instance->CR1);
669 
670  /* Disable UART */
672 
673  /* Update RX threshold configuration */
675 
676  /* Determine the number of data to process during RX/TX ISR execution */
677  UARTEx_SetNbDataToProcess(huart);
678 
679  /* Restore UART configuration */
680  WRITE_REG(huart->Instance->CR1, tmpcr1);
681 
683 
684  /* Process Unlocked */
686 
687  return HAL_OK;
688 }
689 
711 HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen,
712  uint32_t Timeout)
713 {
714  uint8_t *pdata8bits;
715  uint16_t *pdata16bits;
716  uint16_t uhMask;
717  uint32_t tickstart;
718 
719  /* Check that a Rx process is not already ongoing */
721  {
722  if ((pData == NULL) || (Size == 0U))
723  {
724  return HAL_ERROR;
725  }
726 
727  __HAL_LOCK(huart);
728 
732 
733  /* Init tickstart for timeout management */
734  tickstart = HAL_GetTick();
735 
736  huart->RxXferSize = Size;
737  huart->RxXferCount = Size;
738 
739  /* Computation of UART mask to apply to RDR register */
741  uhMask = huart->Mask;
742 
743  /* In case of 9bits/No Parity transfer, pRxData needs to be handled as a uint16_t pointer */
745  {
746  pdata8bits = NULL;
747  pdata16bits = (uint16_t *) pData;
748  }
749  else
750  {
751  pdata8bits = pData;
752  pdata16bits = NULL;
753  }
754 
756 
757  /* Initialize output number of received elements */
758  *RxLen = 0U;
759 
760  /* as long as data have to be received */
761  while (huart->RxXferCount > 0U)
762  {
763  /* Check if IDLE flag is set */
765  {
766  /* Clear IDLE flag in ISR */
768 
769  /* If Set, but no data ever received, clear flag without exiting loop */
770  /* If Set, and data has already been received, this means Idle Event is valid : End reception */
771  if (*RxLen > 0U)
772  {
774 
775  return HAL_OK;
776  }
777  }
778 
779  /* Check if RXNE flag is set */
781  {
782  if (pdata8bits == NULL)
783  {
784  *pdata16bits = (uint16_t)(huart->Instance->RDR & uhMask);
785  pdata16bits++;
786  }
787  else
788  {
789  *pdata8bits = (uint8_t)(huart->Instance->RDR & (uint8_t)uhMask);
790  pdata8bits++;
791  }
792  /* Increment number of received elements */
793  *RxLen += 1U;
794  huart->RxXferCount--;
795  }
796 
797  /* Check for the Timeout */
798  if (Timeout != HAL_MAX_DELAY)
799  {
800  if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
801  {
803 
804  return HAL_TIMEOUT;
805  }
806  }
807  }
808 
809  /* Set number of received elements in output parameter : RxLen */
810  *RxLen = huart->RxXferSize - huart->RxXferCount;
811  /* At end of Rx process, restore huart->RxState to Ready */
813 
814  return HAL_OK;
815  }
816  else
817  {
818  return HAL_BUSY;
819  }
820 }
821 
837 {
838  HAL_StatusTypeDef status;
839 
840  /* Check that a Rx process is not already ongoing */
842  {
843  if ((pData == NULL) || (Size == 0U))
844  {
845  return HAL_ERROR;
846  }
847 
848  __HAL_LOCK(huart);
849 
850  /* Set Reception type to reception till IDLE Event*/
852 
853  status = UART_Start_Receive_IT(huart, pData, Size);
854 
855  /* Check Rx process has been successfully started */
856  if (status == HAL_OK)
857  {
859  {
862  }
863  else
864  {
865  /* In case of errors already pending when reception is started,
866  Interrupts may have already been raised and lead to reception abortion.
867  (Overrun error for instance).
868  In such case Reception Type has been reset to HAL_UART_RECEPTION_STANDARD. */
869  status = HAL_ERROR;
870  }
871  }
872 
873  return status;
874  }
875  else
876  {
877  return HAL_BUSY;
878  }
879 }
880 
899 {
900  HAL_StatusTypeDef status;
901 
902  /* Check that a Rx process is not already ongoing */
904  {
905  if ((pData == NULL) || (Size == 0U))
906  {
907  return HAL_ERROR;
908  }
909 
910  __HAL_LOCK(huart);
911 
912  /* Set Reception type to reception till IDLE Event*/
914 
915  status = UART_Start_Receive_DMA(huart, pData, Size);
916 
917  /* Check Rx process has been successfully started */
918  if (status == HAL_OK)
919  {
921  {
924  }
925  else
926  {
927  /* In case of errors already pending when reception is started,
928  Interrupts may have already been raised and lead to reception abortion.
929  (Overrun error for instance).
930  In such case Reception Type has been reset to HAL_UART_RECEPTION_STANDARD. */
931  status = HAL_ERROR;
932  }
933  }
934 
935  return status;
936  }
937  else
938  {
939  return HAL_BUSY;
940  }
941 }
942 
961 static void UARTEx_Wakeup_AddressConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection)
962 {
964 
965  /* Set the USART address length */
967 
968  /* Set the USART address node */
969  MODIFY_REG(huart->Instance->CR2, USART_CR2_ADD, ((uint32_t)WakeUpSelection.Address << UART_CR2_ADDRESS_LSB_POS));
970 }
971 
979 static void UARTEx_SetNbDataToProcess(UART_HandleTypeDef *huart)
980 {
981  uint8_t rx_fifo_depth;
982  uint8_t tx_fifo_depth;
983  uint8_t rx_fifo_threshold;
984  uint8_t tx_fifo_threshold;
985  static const uint8_t numerator[] = {1U, 1U, 1U, 3U, 7U, 1U, 0U, 0U};
986  static const uint8_t denominator[] = {8U, 4U, 2U, 4U, 8U, 1U, 1U, 1U};
987 
989  {
990  huart->NbTxDataToProcess = 1U;
991  huart->NbRxDataToProcess = 1U;
992  }
993  else
994  {
995  rx_fifo_depth = RX_FIFO_DEPTH;
996  tx_fifo_depth = TX_FIFO_DEPTH;
997  rx_fifo_threshold = (uint8_t)(READ_BIT(huart->Instance->CR3, USART_CR3_RXFTCFG) >> USART_CR3_RXFTCFG_Pos);
998  tx_fifo_threshold = (uint8_t)(READ_BIT(huart->Instance->CR3, USART_CR3_TXFTCFG) >> USART_CR3_TXFTCFG_Pos);
999  huart->NbTxDataToProcess = ((uint16_t)tx_fifo_depth * numerator[tx_fifo_threshold]) /
1000  (uint16_t)denominator[tx_fifo_threshold];
1001  huart->NbRxDataToProcess = ((uint16_t)rx_fifo_depth * numerator[rx_fifo_threshold]) /
1002  (uint16_t)denominator[rx_fifo_threshold];
1003  }
1004 }
1009 #endif /* HAL_UART_MODULE_ENABLED */
1010 
1019 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
IS_UART_RXFIFO_THRESHOLD
#define IS_UART_RXFIFO_THRESHOLD(__THRESHOLD__)
Ensure that UART RXFIFO threshold level is valid.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:843
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
HAL_MultiProcessorEx_AddressLength_Set
HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set(UART_HandleTypeDef *huart, uint32_t AddressLength)
IS_UART_ADDRESSLENGTH_DETECT
#define IS_UART_ADDRESSLENGTH_DETECT(__ADDRESS__)
Ensure that UART wake-up address length is valid.
Definition: stm32f7xx_hal_uart_ex.h:402
UART_CR1_DEDT_ADDRESS_LSB_POS
#define UART_CR1_DEDT_ADDRESS_LSB_POS
Definition: stm32f7xx_hal_uart.h:625
UART_FLAG_IDLE
#define UART_FLAG_IDLE
Definition: stm32f4xx_hal_uart.h:339
HAL_UARTEx_ReceiveToIdle_IT
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
USART_CR3_RXFTCFG
#define USART_CR3_RXFTCFG
Definition: stm32h735xx.h:21595
__UART_HandleTypeDef::Init
UART_InitTypeDef Init
Definition: stm32f4xx_hal_uart.h:145
__UART_HandleTypeDef::NbRxDataToProcess
uint16_t NbRxDataToProcess
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:237
HAL_UARTEx_StopModeWakeUpSourceConfig
HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection)
USART_CR1_DEAT
#define USART_CR1_DEAT
Definition: stm32f769xx.h:15277
__UART_HandleTypeDef::NbTxDataToProcess
uint16_t NbTxDataToProcess
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:239
NULL
#define NULL
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/speex_resampler/thirdparty/resample.c:92
HAL_UARTEx_DisableFifoMode
HAL_StatusTypeDef HAL_UARTEx_DisableFifoMode(UART_HandleTypeDef *huart)
USART_CR2_ADD
#define USART_CR2_ADD
Definition: stm32f407xx.h:12552
HAL_UNLOCKED
@ HAL_UNLOCKED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:53
UART_WAKEUP_ON_ADDRESS
#define UART_WAKEUP_ON_ADDRESS
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:662
huart
UART_HandleTypeDef huart
Definition: pv_stm32f469.c:31
UART_CLEAR_IDLEF
#define UART_CLEAR_IDLEF
Definition: stm32f7xx_hal_uart.h:727
UART_ADVFEATURE_NO_INIT
#define UART_ADVFEATURE_NO_INIT
Definition: stm32f7xx_hal_uart.h:480
UART_AdvFeatureConfig
void UART_AdvFeatureConfig(UART_HandleTypeDef *huart)
HAL_UARTEx_DisableStopMode
HAL_StatusTypeDef HAL_UARTEx_DisableStopMode(UART_HandleTypeDef *huart)
UART_InitTypeDef::WordLength
uint32_t WordLength
Definition: stm32f4xx_hal_uart.h:55
__UART_HandleTypeDef
UART handle Structure definition.
Definition: stm32f4xx_hal_uart.h:141
__HAL_UART_ENABLE
#define __HAL_UART_ENABLE(__HANDLE__)
Enable UART.
Definition: stm32f4xx_hal_uart.h:652
USART_TypeDef::CR1
__IO uint32_t CR1
Definition: stm32f407xx.h:763
USART_CR2_ADDM7
#define USART_CR2_ADDM7
Definition: stm32f769xx.h:15298
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
UART_WORDLENGTH_9B
#define UART_WORDLENGTH_9B
Definition: stm32f4xx_hal_uart.h:248
__HAL_UART_GET_FLAG
#define __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__)
Checks whether the specified UART flag is set or not.
Definition: stm32f4xx_hal_uart.h:426
__HAL_UART_DISABLE
#define __HAL_UART_DISABLE(__HANDLE__)
Disable UART.
Definition: stm32f4xx_hal_uart.h:658
CLEAR_BIT
#define CLEAR_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:214
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:323
USART_CR3_DEM
#define USART_CR3_DEM
Definition: stm32f769xx.h:15400
USART_CR3_DEP
#define USART_CR3_DEP
Definition: stm32f769xx.h:15403
UART_CR2_ADDRESS_LSB_POS
#define UART_CR2_ADDRESS_LSB_POS
Definition: stm32f7xx_hal_uart.h:588
HAL_UARTEx_EnableFifoMode
HAL_StatusTypeDef HAL_UARTEx_EnableFifoMode(UART_HandleTypeDef *huart)
HAL_UART_MspInit
void HAL_UART_MspInit(UART_HandleTypeDef *huart)
UART MSP Initialization This function configures the hardware resources used in this example.
Definition: stm32h7xx_hal_msp.c:320
USART_CR1_FIFOEN
#define USART_CR1_FIFOEN
Definition: stm32h735xx.h:21446
HAL_UARTEx_EnableStopMode
HAL_StatusTypeDef HAL_UARTEx_EnableStopMode(UART_HandleTypeDef *huart)
UART_WakeUpTypeDef::Address
uint8_t Address
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:57
USART_CR1_UESM
#define USART_CR1_UESM
Definition: stm32f769xx.h:15223
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
IS_UART_FIFO_INSTANCE
#define IS_UART_FIFO_INSTANCE(INSTANCE)
Definition: stm32h735xx.h:24546
UART_WakeUpTypeDef::AddressLength
uint16_t AddressLength
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:54
IS_UART_DE_POLARITY
#define IS_UART_DE_POLARITY(__POLARITY__)
Ensure that UART driver enable polarity is valid.
Definition: stm32f7xx_hal_uart.h:1388
UART_CheckIdleState
HAL_StatusTypeDef UART_CheckIdleState(UART_HandleTypeDef *huart)
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
IS_UART_TXFIFO_THRESHOLD
#define IS_UART_TXFIFO_THRESHOLD(__THRESHOLD__)
Ensure that UART TXFIFO threshold level is valid.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:831
UART_FIFOMODE_ENABLE
#define UART_FIFOMODE_ENABLE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:93
HAL_UARTEx_TxFifoEmptyCallback
void HAL_UARTEx_TxFifoEmptyCallback(UART_HandleTypeDef *huart)
UART_WakeUpTypeDef
UART wake up from stop mode parameters.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:47
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
UART_FIFOMODE_DISABLE
#define UART_FIFOMODE_DISABLE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:92
USART_TypeDef::RDR
__IO uint32_t RDR
Definition: stm32f769xx.h:1017
USART_ISR_REACK
#define USART_ISR_REACK
Definition: stm32f769xx.h:15530
HAL_UART_RECEPTION_TOIDLE
#define HAL_UART_RECEPTION_TOIDLE
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:816
MODIFY_REG
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:224
RESET
@ RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:187
__UART_HandleTypeDef::Mask
uint16_t Mask
Definition: stm32f7xx_hal_uart.h:205
__UART_HandleTypeDef::Lock
HAL_LockTypeDef Lock
Definition: stm32f4xx_hal_uart.h:163
IS_UART_DRIVER_ENABLE_INSTANCE
#define IS_UART_DRIVER_ENABLE_INSTANCE(__INSTANCE__)
Definition: stm32f769xx.h:21985
HAL_BUSY
@ HAL_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:44
UART_FLAG_RXNE
#define UART_FLAG_RXNE
Definition: stm32f4xx_hal_uart.h:338
UART_Start_Receive_IT
HAL_StatusTypeDef UART_Start_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
__UART_HandleTypeDef::RxState
__IO HAL_UART_StateTypeDef RxState
Definition: stm32f4xx_hal_uart.h:169
HAL_UART_TIMEOUT_VALUE
#define HAL_UART_TIMEOUT_VALUE
Definition: stm32f7xx_hal_uart.h:641
HAL_UART_STATE_BUSY_RX
@ HAL_UART_STATE_BUSY_RX
Definition: stm32f4xx_hal_uart.h:127
USART_CR1_DEDT
#define USART_CR1_DEDT
Definition: stm32f769xx.h:15269
USART_TypeDef::CR3
__IO uint32_t CR3
Definition: stm32f407xx.h:765
USART_TypeDef::CR2
__IO uint32_t CR2
Definition: stm32f407xx.h:764
__HAL_UNLOCK
#define __HAL_UNLOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:105
READ_BIT
#define READ_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:216
IS_UART_ASSERTIONTIME
#define IS_UART_ASSERTIONTIME(__TIME__)
Check UART assertion time.
Definition: stm32f7xx_hal_uart.h:1121
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:61
__UART_HandleTypeDef::AdvancedInit
UART_AdvFeatureInitTypeDef AdvancedInit
Definition: stm32f7xx_hal_uart.h:191
UART_WakeUpTypeDef::WakeUpEvent
uint32_t WakeUpEvent
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart_ex.h:49
__UART_HandleTypeDef::FifoMode
uint32_t FifoMode
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:234
__UART_HandleTypeDef::gState
__IO HAL_UART_StateTypeDef gState
Definition: stm32f4xx_hal_uart.h:165
HAL_UART_ERROR_NONE
#define HAL_UART_ERROR_NONE
Definition: stm32f4xx_hal_uart.h:231
__UART_HandleTypeDef::RxXferSize
uint16_t RxXferSize
Definition: stm32f4xx_hal_uart.h:155
UART_SetConfig
HAL_StatusTypeDef UART_SetConfig(UART_HandleTypeDef *huart)
IS_UART_WAKEUP_SELECTION
#define IS_UART_WAKEUP_SELECTION(__WAKE__)
Ensure that UART wake-up selection is valid.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:1541
__UART_HandleTypeDef::ErrorCode
__IO uint32_t ErrorCode
Definition: stm32f4xx_hal_uart.h:172
HAL_TIMEOUT
@ HAL_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:45
IS_UART_DEASSERTIONTIME
#define IS_UART_DEASSERTIONTIME(__TIME__)
Check UART deassertion time.
Definition: stm32f7xx_hal_uart.h:1127
UART_WaitOnFlagUntilTimeout
HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout)
UART_MASK_COMPUTATION
#define UART_MASK_COMPUTATION(__HANDLE__)
Report the UART mask to apply to retrieve the received data according to the word length and to the p...
Definition: stm32f7xx_hal_uart_ex.h:347
UART_Start_Receive_DMA
HAL_StatusTypeDef UART_Start_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
HAL_UART_STATE_RESET
@ HAL_UART_STATE_RESET
Definition: stm32f4xx_hal_uart.h:119
UART_CR1_DEAT_ADDRESS_LSB_POS
#define UART_CR1_DEAT_ADDRESS_LSB_POS
Definition: stm32f7xx_hal_uart.h:617
USART_CR3_WUS
#define USART_CR3_WUS
Definition: stm32f769xx.h:15412
__UART_HandleTypeDef::ReceptionType
__IO HAL_UART_RxTypeTypeDef ReceptionType
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_uart.h:241
HAL_UARTEx_ReceiveToIdle_DMA
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
USART_CR3_RXFTCFG_Pos
#define USART_CR3_RXFTCFG_Pos
Definition: stm32h735xx.h:21593
UART_PARITY_NONE
#define UART_PARITY_NONE
Definition: stm32f4xx_hal_uart.h:265
USART_CR3_TXFTCFG
#define USART_CR3_TXFTCFG
Definition: stm32h735xx.h:21604
WRITE_REG
#define WRITE_REG(REG, VAL)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:220
HAL_UARTEx_SetTxFifoThreshold
HAL_StatusTypeDef HAL_UARTEx_SetTxFifoThreshold(UART_HandleTypeDef *huart, uint32_t Threshold)
HAL_RS485Ex_Init
HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime, uint32_t DeassertionTime)
READ_REG
#define READ_REG(REG)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:222
SET_BIT
#define SET_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:212
HAL_UARTEx_SetRxFifoThreshold
HAL_StatusTypeDef HAL_UARTEx_SetRxFifoThreshold(UART_HandleTypeDef *huart, uint32_t Threshold)
IS_UART_WAKEUP_FROMSTOP_INSTANCE
#define IS_UART_WAKEUP_FROMSTOP_INSTANCE(__INSTANCE__)
Definition: stm32f769xx.h:22025
__UART_HandleTypeDef::Instance
USART_TypeDef * Instance
Definition: stm32f4xx_hal_uart.h:143
UART_AdvFeatureInitTypeDef::AdvFeatureInit
uint32_t AdvFeatureInit
Definition: stm32f7xx_hal_uart.h:94
HAL_UARTEx_ReceiveToIdle
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen, uint32_t Timeout)
__HAL_UART_CLEAR_FLAG
#define __HAL_UART_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clears the specified UART pending flag.
Definition: stm32f4xx_hal_uart.h:450
USART_CR3_TXFTCFG_Pos
#define USART_CR3_TXFTCFG_Pos
Definition: stm32h735xx.h:21602
HAL_UART_STATE_BUSY
@ HAL_UART_STATE_BUSY
Definition: stm32f4xx_hal_uart.h:123
__UART_HandleTypeDef::RxXferCount
__IO uint16_t RxXferCount
Definition: stm32f4xx_hal_uart.h:157
HAL_UARTEx_WakeupCallback
void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart)
HAL_UARTEx_RxFifoFullCallback
void HAL_UARTEx_RxFifoFullCallback(UART_HandleTypeDef *huart)
UART_InitTypeDef::Parity
uint32_t Parity
Definition: stm32f4xx_hal_uart.h:61
USART_CR1_IDLEIE
#define USART_CR1_IDLEIE
Definition: stm32f407xx.h:12517
HAL_UART_STATE_READY
@ HAL_UART_STATE_READY
Definition: stm32f4xx_hal_uart.h:121


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:55