stm32h7xx_hal_tim_ex.c
Go to the documentation of this file.
1 
78 /* Includes ------------------------------------------------------------------*/
79 #include "stm32h7xx_hal.h"
80 
90 #ifdef HAL_TIM_MODULE_ENABLED
91 
92 /* Private typedef -----------------------------------------------------------*/
93 /* Private define ------------------------------------------------------------*/
94 /* Private macros ------------------------------------------------------------*/
95 /* Private variables ---------------------------------------------------------*/
96 /* Private function prototypes -----------------------------------------------*/
97 static void TIM_DMADelayPulseNCplt(DMA_HandleTypeDef *hdma);
98 static void TIM_DMAErrorCCxN(DMA_HandleTypeDef *hdma);
99 static void TIM_CCxNChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelNState);
100 
101 /* Exported functions --------------------------------------------------------*/
137 {
138  TIM_OC_InitTypeDef OC_Config;
139 
140  /* Check the TIM handle allocation */
141  if (htim == NULL)
142  {
143  return HAL_ERROR;
144  }
145 
146  /* Check the parameters */
154 
155  if (htim->State == HAL_TIM_STATE_RESET)
156  {
157  /* Allocate lock resource and initialize it */
158  htim->Lock = HAL_UNLOCKED;
159 
160 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
161  /* Reset interrupt callbacks to legacy week callbacks */
162  TIM_ResetCallback(htim);
163 
164  if (htim->HallSensor_MspInitCallback == NULL)
165  {
166  htim->HallSensor_MspInitCallback = HAL_TIMEx_HallSensor_MspInit;
167  }
168  /* Init the low level hardware : GPIO, CLOCK, NVIC */
169  htim->HallSensor_MspInitCallback(htim);
170 #else
171  /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */
173 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
174  }
175 
176  /* Set the TIM state */
177  htim->State = HAL_TIM_STATE_BUSY;
178 
179  /* Configure the Time base in the Encoder Mode */
180  TIM_Base_SetConfig(htim->Instance, &htim->Init);
181 
182  /* Configure the Channel 1 as Input Channel to interface with the three Outputs of the Hall sensor */
184 
185  /* Reset the IC1PSC Bits */
186  htim->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC;
187  /* Set the IC1PSC value */
188  htim->Instance->CCMR1 |= sConfig->IC1Prescaler;
189 
190  /* Enable the Hall sensor interface (XOR function of the three inputs) */
191  htim->Instance->CR2 |= TIM_CR2_TI1S;
192 
193  /* Select the TIM_TS_TI1F_ED signal as Input trigger for the TIM */
194  htim->Instance->SMCR &= ~TIM_SMCR_TS;
195  htim->Instance->SMCR |= TIM_TS_TI1F_ED;
196 
197  /* Use the TIM_TS_TI1F_ED signal to reset the TIM counter each edge detection */
198  htim->Instance->SMCR &= ~TIM_SMCR_SMS;
200 
201  /* Program channel 2 in PWM 2 mode with the desired Commutation_Delay*/
202  OC_Config.OCFastMode = TIM_OCFAST_DISABLE;
204  OC_Config.OCMode = TIM_OCMODE_PWM2;
206  OC_Config.OCNPolarity = TIM_OCNPOLARITY_HIGH;
207  OC_Config.OCPolarity = TIM_OCPOLARITY_HIGH;
208  OC_Config.Pulse = sConfig->Commutation_Delay;
209 
210  TIM_OC2_SetConfig(htim->Instance, &OC_Config);
211 
212  /* Select OC2REF as trigger output on TRGO: write the MMS bits in the TIMx_CR2
213  register to 101 */
214  htim->Instance->CR2 &= ~TIM_CR2_MMS;
215  htim->Instance->CR2 |= TIM_TRGO_OC2REF;
216 
217  /* Initialize the DMA burst operation state */
219 
220  /* Initialize the TIM channels state */
225 
226  /* Initialize the TIM state*/
227  htim->State = HAL_TIM_STATE_READY;
228 
229  return HAL_OK;
230 }
231 
238 {
239  /* Check the parameters */
241 
242  htim->State = HAL_TIM_STATE_BUSY;
243 
244  /* Disable the TIM Peripheral Clock */
245  __HAL_TIM_DISABLE(htim);
246 
247 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
248  if (htim->HallSensor_MspDeInitCallback == NULL)
249  {
250  htim->HallSensor_MspDeInitCallback = HAL_TIMEx_HallSensor_MspDeInit;
251  }
252  /* DeInit the low level hardware */
253  htim->HallSensor_MspDeInitCallback(htim);
254 #else
255  /* DeInit the low level hardware: GPIO, CLOCK, NVIC */
257 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
258 
259  /* Change the DMA burst operation state */
261 
262  /* Change the TIM channels state */
267 
268  /* Change TIM state */
269  htim->State = HAL_TIM_STATE_RESET;
270 
271  /* Release Lock */
272  __HAL_UNLOCK(htim);
273 
274  return HAL_OK;
275 }
276 
283 {
284  /* Prevent unused argument(s) compilation warning */
285  UNUSED(htim);
286 
287  /* NOTE : This function should not be modified, when the callback is needed,
288  the HAL_TIMEx_HallSensor_MspInit could be implemented in the user file
289  */
290 }
291 
298 {
299  /* Prevent unused argument(s) compilation warning */
300  UNUSED(htim);
301 
302  /* NOTE : This function should not be modified, when the callback is needed,
303  the HAL_TIMEx_HallSensor_MspDeInit could be implemented in the user file
304  */
305 }
306 
313 {
314  uint32_t tmpsmcr;
317  HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1);
318  HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2);
319 
320  /* Check the parameters */
322 
323  /* Check the TIM channels state */
324  if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
325  || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY)
326  || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
327  || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY))
328  {
329  return HAL_ERROR;
330  }
331 
332  /* Set the TIM channels state */
337 
338  /* Enable the Input Capture channel 1
339  (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
341 
342  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
343  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
344  {
345  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
346  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
347  {
348  __HAL_TIM_ENABLE(htim);
349  }
350  }
351  else
352  {
353  __HAL_TIM_ENABLE(htim);
354  }
355 
356  /* Return function status */
357  return HAL_OK;
358 }
359 
366 {
367  /* Check the parameters */
369 
370  /* Disable the Input Capture channels 1, 2 and 3
371  (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
373 
374  /* Disable the Peripheral */
375  __HAL_TIM_DISABLE(htim);
376 
377  /* Set the TIM channels state */
382 
383  /* Return function status */
384  return HAL_OK;
385 }
386 
393 {
394  uint32_t tmpsmcr;
397  HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1);
398  HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2);
399 
400  /* Check the parameters */
402 
403  /* Check the TIM channels state */
404  if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
405  || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY)
406  || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
407  || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY))
408  {
409  return HAL_ERROR;
410  }
411 
412  /* Set the TIM channels state */
417 
418  /* Enable the capture compare Interrupts 1 event */
420 
421  /* Enable the Input Capture channel 1
422  (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
424 
425  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
426  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
427  {
428  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
429  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
430  {
431  __HAL_TIM_ENABLE(htim);
432  }
433  }
434  else
435  {
436  __HAL_TIM_ENABLE(htim);
437  }
438 
439  /* Return function status */
440  return HAL_OK;
441 }
442 
449 {
450  /* Check the parameters */
452 
453  /* Disable the Input Capture channel 1
454  (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
456 
457  /* Disable the capture compare Interrupts event */
459 
460  /* Disable the Peripheral */
461  __HAL_TIM_DISABLE(htim);
462 
463  /* Set the TIM channels state */
468 
469  /* Return function status */
470  return HAL_OK;
471 }
472 
480 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length)
481 {
482  uint32_t tmpsmcr;
484  HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1);
485 
486  /* Check the parameters */
488 
489  /* Set the TIM channel state */
490  if ((channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY)
491  || (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY))
492  {
493  return HAL_BUSY;
494  }
495  else if ((channel_1_state == HAL_TIM_CHANNEL_STATE_READY)
496  && (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_READY))
497  {
498  if ((pData == NULL) && (Length > 0U))
499  {
500  return HAL_ERROR;
501  }
502  else
503  {
506  }
507  }
508  else
509  {
510  return HAL_ERROR;
511  }
512 
513  /* Enable the Input Capture channel 1
514  (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
516 
517  /* Set the DMA Input Capture 1 Callbacks */
520  /* Set the DMA error callback */
522 
523  /* Enable the DMA stream for Capture 1*/
524  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, Length) != HAL_OK)
525  {
526  /* Return error status */
527  return HAL_ERROR;
528  }
529  /* Enable the capture compare 1 Interrupt */
531 
532  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
533  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
534  {
535  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
536  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
537  {
538  __HAL_TIM_ENABLE(htim);
539  }
540  }
541  else
542  {
543  __HAL_TIM_ENABLE(htim);
544  }
545 
546  /* Return function status */
547  return HAL_OK;
548 }
549 
556 {
557  /* Check the parameters */
559 
560  /* Disable the Input Capture channel 1
561  (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
563 
564 
565  /* Disable the capture compare Interrupts 1 event */
567 
568  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]);
569 
570  /* Disable the Peripheral */
571  __HAL_TIM_DISABLE(htim);
572 
573  /* Set the TIM channel state */
576 
577  /* Return function status */
578  return HAL_OK;
579 }
580 
617 {
618  uint32_t tmpsmcr;
619 
620  /* Check the parameters */
621  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
622 
623  /* Check the TIM complementary channel state */
625  {
626  return HAL_ERROR;
627  }
628 
629  /* Set the TIM complementary channel state */
631 
632  /* Enable the Capture compare channel N */
633  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
634 
635  /* Enable the Main Output */
636  __HAL_TIM_MOE_ENABLE(htim);
637 
638  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
639  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
640  {
641  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
642  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
643  {
644  __HAL_TIM_ENABLE(htim);
645  }
646  }
647  else
648  {
649  __HAL_TIM_ENABLE(htim);
650  }
651 
652  /* Return function status */
653  return HAL_OK;
654 }
655 
668 {
669  /* Check the parameters */
670  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
671 
672  /* Disable the Capture compare channel N */
673  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
674 
675  /* Disable the Main Output */
676  __HAL_TIM_MOE_DISABLE(htim);
677 
678  /* Disable the Peripheral */
679  __HAL_TIM_DISABLE(htim);
680 
681  /* Set the TIM complementary channel state */
683 
684  /* Return function status */
685  return HAL_OK;
686 }
687 
700 {
701  uint32_t tmpsmcr;
702 
703  /* Check the parameters */
704  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
705 
706  /* Check the TIM complementary channel state */
708  {
709  return HAL_ERROR;
710  }
711 
712  /* Set the TIM complementary channel state */
714 
715  switch (Channel)
716  {
717  case TIM_CHANNEL_1:
718  {
719  /* Enable the TIM Output Compare interrupt */
721  break;
722  }
723 
724  case TIM_CHANNEL_2:
725  {
726  /* Enable the TIM Output Compare interrupt */
728  break;
729  }
730 
731  case TIM_CHANNEL_3:
732  {
733  /* Enable the TIM Output Compare interrupt */
735  break;
736  }
737 
738 
739  default:
740  break;
741  }
742 
743  /* Enable the TIM Break interrupt */
745 
746  /* Enable the Capture compare channel N */
747  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
748 
749  /* Enable the Main Output */
750  __HAL_TIM_MOE_ENABLE(htim);
751 
752  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
753  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
754  {
755  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
756  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
757  {
758  __HAL_TIM_ENABLE(htim);
759  }
760  }
761  else
762  {
763  __HAL_TIM_ENABLE(htim);
764  }
765 
766  /* Return function status */
767  return HAL_OK;
768 }
769 
782 {
783  uint32_t tmpccer;
784  /* Check the parameters */
785  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
786 
787  switch (Channel)
788  {
789  case TIM_CHANNEL_1:
790  {
791  /* Disable the TIM Output Compare interrupt */
793  break;
794  }
795 
796  case TIM_CHANNEL_2:
797  {
798  /* Disable the TIM Output Compare interrupt */
800  break;
801  }
802 
803  case TIM_CHANNEL_3:
804  {
805  /* Disable the TIM Output Compare interrupt */
807  break;
808  }
809 
810  default:
811  break;
812  }
813 
814  /* Disable the Capture compare channel N */
815  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
816 
817  /* Disable the TIM Break interrupt (only if no more channel is active) */
818  tmpccer = htim->Instance->CCER;
819  if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET)
820  {
822  }
823 
824  /* Disable the Main Output */
825  __HAL_TIM_MOE_DISABLE(htim);
826 
827  /* Disable the Peripheral */
828  __HAL_TIM_DISABLE(htim);
829 
830  /* Set the TIM complementary channel state */
832 
833  /* Return function status */
834  return HAL_OK;
835 }
836 
850 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
851 {
852  uint32_t tmpsmcr;
853 
854  /* Check the parameters */
855  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
856 
857  /* Set the TIM complementary channel state */
859  {
860  return HAL_BUSY;
861  }
862  else if (TIM_CHANNEL_N_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_READY)
863  {
864  if ((pData == NULL) && (Length > 0U))
865  {
866  return HAL_ERROR;
867  }
868  else
869  {
871  }
872  }
873  else
874  {
875  return HAL_ERROR;
876  }
877 
878  switch (Channel)
879  {
880  case TIM_CHANNEL_1:
881  {
882  /* Set the DMA compare callbacks */
883  htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseNCplt;
885 
886  /* Set the DMA error callback */
887  htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAErrorCCxN ;
888 
889  /* Enable the DMA stream */
890  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length) != HAL_OK)
891  {
892  /* Return error status */
893  return HAL_ERROR;
894  }
895  /* Enable the TIM Output Compare DMA request */
897  break;
898  }
899 
900  case TIM_CHANNEL_2:
901  {
902  /* Set the DMA compare callbacks */
903  htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseNCplt;
905 
906  /* Set the DMA error callback */
907  htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAErrorCCxN ;
908 
909  /* Enable the DMA stream */
910  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length) != HAL_OK)
911  {
912  /* Return error status */
913  return HAL_ERROR;
914  }
915  /* Enable the TIM Output Compare DMA request */
917  break;
918  }
919 
920  case TIM_CHANNEL_3:
921  {
922  /* Set the DMA compare callbacks */
923  htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseNCplt;
925 
926  /* Set the DMA error callback */
927  htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAErrorCCxN ;
928 
929  /* Enable the DMA stream */
930  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3, Length) != HAL_OK)
931  {
932  /* Return error status */
933  return HAL_ERROR;
934  }
935  /* Enable the TIM Output Compare DMA request */
937  break;
938  }
939 
940  default:
941  break;
942  }
943 
944  /* Enable the Capture compare channel N */
945  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
946 
947  /* Enable the Main Output */
948  __HAL_TIM_MOE_ENABLE(htim);
949 
950  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
951  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
952  {
953  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
954  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
955  {
956  __HAL_TIM_ENABLE(htim);
957  }
958  }
959  else
960  {
961  __HAL_TIM_ENABLE(htim);
962  }
963 
964  /* Return function status */
965  return HAL_OK;
966 }
967 
980 {
981  /* Check the parameters */
982  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
983 
984  switch (Channel)
985  {
986  case TIM_CHANNEL_1:
987  {
988  /* Disable the TIM Output Compare DMA request */
990  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]);
991  break;
992  }
993 
994  case TIM_CHANNEL_2:
995  {
996  /* Disable the TIM Output Compare DMA request */
998  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]);
999  break;
1000  }
1001 
1002  case TIM_CHANNEL_3:
1003  {
1004  /* Disable the TIM Output Compare DMA request */
1006  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]);
1007  break;
1008  }
1009 
1010  default:
1011  break;
1012  }
1013 
1014  /* Disable the Capture compare channel N */
1015  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
1016 
1017  /* Disable the Main Output */
1018  __HAL_TIM_MOE_DISABLE(htim);
1019 
1020  /* Disable the Peripheral */
1021  __HAL_TIM_DISABLE(htim);
1022 
1023  /* Set the TIM complementary channel state */
1025 
1026  /* Return function status */
1027  return HAL_OK;
1028 }
1029 
1075 {
1076  uint32_t tmpsmcr;
1077 
1078  /* Check the parameters */
1079  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1080 
1081  /* Check the TIM complementary channel state */
1083  {
1084  return HAL_ERROR;
1085  }
1086 
1087  /* Set the TIM complementary channel state */
1089 
1090  /* Enable the complementary PWM output */
1091  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
1092 
1093  /* Enable the Main Output */
1094  __HAL_TIM_MOE_ENABLE(htim);
1095 
1096  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
1097  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
1098  {
1099  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
1100  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
1101  {
1102  __HAL_TIM_ENABLE(htim);
1103  }
1104  }
1105  else
1106  {
1107  __HAL_TIM_ENABLE(htim);
1108  }
1109 
1110  /* Return function status */
1111  return HAL_OK;
1112 }
1113 
1125 {
1126  /* Check the parameters */
1127  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1128 
1129  /* Disable the complementary PWM output */
1130  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
1131 
1132  /* Disable the Main Output */
1133  __HAL_TIM_MOE_DISABLE(htim);
1134 
1135  /* Disable the Peripheral */
1136  __HAL_TIM_DISABLE(htim);
1137 
1138  /* Set the TIM complementary channel state */
1140 
1141  /* Return function status */
1142  return HAL_OK;
1143 }
1144 
1157 {
1158  uint32_t tmpsmcr;
1159 
1160  /* Check the parameters */
1161  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1162 
1163  /* Check the TIM complementary channel state */
1165  {
1166  return HAL_ERROR;
1167  }
1168 
1169  /* Set the TIM complementary channel state */
1171 
1172  switch (Channel)
1173  {
1174  case TIM_CHANNEL_1:
1175  {
1176  /* Enable the TIM Capture/Compare 1 interrupt */
1178  break;
1179  }
1180 
1181  case TIM_CHANNEL_2:
1182  {
1183  /* Enable the TIM Capture/Compare 2 interrupt */
1185  break;
1186  }
1187 
1188  case TIM_CHANNEL_3:
1189  {
1190  /* Enable the TIM Capture/Compare 3 interrupt */
1192  break;
1193  }
1194 
1195  default:
1196  break;
1197  }
1198 
1199  /* Enable the TIM Break interrupt */
1201 
1202  /* Enable the complementary PWM output */
1203  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
1204 
1205  /* Enable the Main Output */
1206  __HAL_TIM_MOE_ENABLE(htim);
1207 
1208  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
1209  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
1210  {
1211  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
1212  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
1213  {
1214  __HAL_TIM_ENABLE(htim);
1215  }
1216  }
1217  else
1218  {
1219  __HAL_TIM_ENABLE(htim);
1220  }
1221 
1222  /* Return function status */
1223  return HAL_OK;
1224 }
1225 
1238 {
1239  uint32_t tmpccer;
1240 
1241  /* Check the parameters */
1242  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1243 
1244  switch (Channel)
1245  {
1246  case TIM_CHANNEL_1:
1247  {
1248  /* Disable the TIM Capture/Compare 1 interrupt */
1250  break;
1251  }
1252 
1253  case TIM_CHANNEL_2:
1254  {
1255  /* Disable the TIM Capture/Compare 2 interrupt */
1257  break;
1258  }
1259 
1260  case TIM_CHANNEL_3:
1261  {
1262  /* Disable the TIM Capture/Compare 3 interrupt */
1264  break;
1265  }
1266 
1267  default:
1268  break;
1269  }
1270 
1271  /* Disable the complementary PWM output */
1272  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
1273 
1274  /* Disable the TIM Break interrupt (only if no more channel is active) */
1275  tmpccer = htim->Instance->CCER;
1276  if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET)
1277  {
1279  }
1280 
1281  /* Disable the Main Output */
1282  __HAL_TIM_MOE_DISABLE(htim);
1283 
1284  /* Disable the Peripheral */
1285  __HAL_TIM_DISABLE(htim);
1286 
1287  /* Set the TIM complementary channel state */
1289 
1290  /* Return function status */
1291  return HAL_OK;
1292 }
1293 
1307 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
1308 {
1309  uint32_t tmpsmcr;
1310 
1311  /* Check the parameters */
1312  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1313 
1314  /* Set the TIM complementary channel state */
1316  {
1317  return HAL_BUSY;
1318  }
1319  else if (TIM_CHANNEL_N_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_READY)
1320  {
1321  if ((pData == NULL) && (Length > 0U))
1322  {
1323  return HAL_ERROR;
1324  }
1325  else
1326  {
1328  }
1329  }
1330  else
1331  {
1332  return HAL_ERROR;
1333  }
1334 
1335  switch (Channel)
1336  {
1337  case TIM_CHANNEL_1:
1338  {
1339  /* Set the DMA compare callbacks */
1340  htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseNCplt;
1342 
1343  /* Set the DMA error callback */
1344  htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAErrorCCxN ;
1345 
1346  /* Enable the DMA stream */
1347  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length) != HAL_OK)
1348  {
1349  /* Return error status */
1350  return HAL_ERROR;
1351  }
1352  /* Enable the TIM Capture/Compare 1 DMA request */
1354  break;
1355  }
1356 
1357  case TIM_CHANNEL_2:
1358  {
1359  /* Set the DMA compare callbacks */
1360  htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseNCplt;
1362 
1363  /* Set the DMA error callback */
1364  htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAErrorCCxN ;
1365 
1366  /* Enable the DMA stream */
1367  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length) != HAL_OK)
1368  {
1369  /* Return error status */
1370  return HAL_ERROR;
1371  }
1372  /* Enable the TIM Capture/Compare 2 DMA request */
1374  break;
1375  }
1376 
1377  case TIM_CHANNEL_3:
1378  {
1379  /* Set the DMA compare callbacks */
1380  htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseNCplt;
1382 
1383  /* Set the DMA error callback */
1384  htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAErrorCCxN ;
1385 
1386  /* Enable the DMA stream */
1387  if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3, Length) != HAL_OK)
1388  {
1389  /* Return error status */
1390  return HAL_ERROR;
1391  }
1392  /* Enable the TIM Capture/Compare 3 DMA request */
1394  break;
1395  }
1396 
1397  default:
1398  break;
1399  }
1400 
1401  /* Enable the complementary PWM output */
1402  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
1403 
1404  /* Enable the Main Output */
1405  __HAL_TIM_MOE_ENABLE(htim);
1406 
1407  /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */
1408  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
1409  {
1410  tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS;
1411  if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr))
1412  {
1413  __HAL_TIM_ENABLE(htim);
1414  }
1415  }
1416  else
1417  {
1418  __HAL_TIM_ENABLE(htim);
1419  }
1420 
1421  /* Return function status */
1422  return HAL_OK;
1423 }
1424 
1437 {
1438  /* Check the parameters */
1439  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1440 
1441  switch (Channel)
1442  {
1443  case TIM_CHANNEL_1:
1444  {
1445  /* Disable the TIM Capture/Compare 1 DMA request */
1447  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]);
1448  break;
1449  }
1450 
1451  case TIM_CHANNEL_2:
1452  {
1453  /* Disable the TIM Capture/Compare 2 DMA request */
1455  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]);
1456  break;
1457  }
1458 
1459  case TIM_CHANNEL_3:
1460  {
1461  /* Disable the TIM Capture/Compare 3 DMA request */
1463  (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]);
1464  break;
1465  }
1466 
1467  default:
1468  break;
1469  }
1470 
1471  /* Disable the complementary PWM output */
1472  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
1473 
1474  /* Disable the Main Output */
1475  __HAL_TIM_MOE_DISABLE(htim);
1476 
1477  /* Disable the Peripheral */
1478  __HAL_TIM_DISABLE(htim);
1479 
1480  /* Set the TIM complementary channel state */
1482 
1483  /* Return function status */
1484  return HAL_OK;
1485 }
1486 
1521 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
1522 {
1523  uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1;
1526  HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1);
1527  HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2);
1528 
1529  /* Check the parameters */
1530  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1531 
1532  /* Check the TIM channels state */
1533  if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
1534  || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY)
1535  || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
1536  || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY))
1537  {
1538  return HAL_ERROR;
1539  }
1540 
1541  /* Set the TIM channels state */
1546 
1547  /* Enable the complementary One Pulse output channel and the Input Capture channel */
1548  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE);
1549  TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_ENABLE);
1550 
1551  /* Enable the Main Output */
1552  __HAL_TIM_MOE_ENABLE(htim);
1553 
1554  /* Return function status */
1555  return HAL_OK;
1556 }
1557 
1570 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
1571 {
1572  uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1;
1573 
1574  /* Check the parameters */
1575  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1576 
1577  /* Disable the complementary One Pulse output channel and the Input Capture channel */
1578  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE);
1579  TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_DISABLE);
1580 
1581  /* Disable the Main Output */
1582  __HAL_TIM_MOE_DISABLE(htim);
1583 
1584  /* Disable the Peripheral */
1585  __HAL_TIM_DISABLE(htim);
1586 
1587  /* Set the TIM channels state */
1592 
1593  /* Return function status */
1594  return HAL_OK;
1595 }
1596 
1610 {
1611  uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1;
1614  HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1);
1615  HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2);
1616 
1617  /* Check the parameters */
1618  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1619 
1620  /* Check the TIM channels state */
1621  if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
1622  || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY)
1623  || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY)
1624  || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY))
1625  {
1626  return HAL_ERROR;
1627  }
1628 
1629  /* Set the TIM channels state */
1634 
1635  /* Enable the TIM Capture/Compare 1 interrupt */
1637 
1638  /* Enable the TIM Capture/Compare 2 interrupt */
1640 
1641  /* Enable the complementary One Pulse output channel and the Input Capture channel */
1642  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE);
1643  TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_ENABLE);
1644 
1645  /* Enable the Main Output */
1646  __HAL_TIM_MOE_ENABLE(htim);
1647 
1648  /* Return function status */
1649  return HAL_OK;
1650 }
1651 
1665 {
1666  uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1;
1667 
1668  /* Check the parameters */
1669  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1670 
1671  /* Disable the TIM Capture/Compare 1 interrupt */
1673 
1674  /* Disable the TIM Capture/Compare 2 interrupt */
1676 
1677  /* Disable the complementary One Pulse output channel and the Input Capture channel */
1678  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE);
1679  TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_DISABLE);
1680 
1681  /* Disable the Main Output */
1682  __HAL_TIM_MOE_DISABLE(htim);
1683 
1684  /* Disable the Peripheral */
1685  __HAL_TIM_DISABLE(htim);
1686 
1687  /* Set the TIM channels state */
1692 
1693  /* Return function status */
1694  return HAL_OK;
1695 }
1696 
1748  uint32_t CommutationSource)
1749 {
1750  /* Check the parameters */
1753 
1754  __HAL_LOCK(htim);
1755 
1756  if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) ||
1757  (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3) ||
1758  (InputTrigger == TIM_TS_ITR12) || (InputTrigger == TIM_TS_ITR13))
1759  {
1760  /* Select the Input trigger */
1761  htim->Instance->SMCR &= ~TIM_SMCR_TS;
1762  htim->Instance->SMCR |= InputTrigger;
1763  }
1764 
1765  /* Select the Capture Compare preload feature */
1766  htim->Instance->CR2 |= TIM_CR2_CCPC;
1767  /* Select the Commutation event source */
1768  htim->Instance->CR2 &= ~TIM_CR2_CCUS;
1769  htim->Instance->CR2 |= CommutationSource;
1770 
1771  /* Disable Commutation Interrupt */
1773 
1774  /* Disable Commutation DMA request */
1776 
1777  __HAL_UNLOCK(htim);
1778 
1779  return HAL_OK;
1780 }
1781 
1807  uint32_t CommutationSource)
1808 {
1809  /* Check the parameters */
1812 
1813  __HAL_LOCK(htim);
1814 
1815  if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) ||
1816  (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3) ||
1817  (InputTrigger == TIM_TS_ITR12) || (InputTrigger == TIM_TS_ITR13))
1818  {
1819  /* Select the Input trigger */
1820  htim->Instance->SMCR &= ~TIM_SMCR_TS;
1821  htim->Instance->SMCR |= InputTrigger;
1822  }
1823 
1824  /* Select the Capture Compare preload feature */
1825  htim->Instance->CR2 |= TIM_CR2_CCPC;
1826  /* Select the Commutation event source */
1827  htim->Instance->CR2 &= ~TIM_CR2_CCUS;
1828  htim->Instance->CR2 |= CommutationSource;
1829 
1830  /* Disable Commutation DMA request */
1832 
1833  /* Enable the Commutation Interrupt */
1835 
1836  __HAL_UNLOCK(htim);
1837 
1838  return HAL_OK;
1839 }
1840 
1870  uint32_t CommutationSource)
1871 {
1872  /* Check the parameters */
1875 
1876  __HAL_LOCK(htim);
1877 
1878  if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) ||
1879  (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3) ||
1880  (InputTrigger == TIM_TS_ITR12) || (InputTrigger == TIM_TS_ITR13))
1881  {
1882  /* Select the Input trigger */
1883  htim->Instance->SMCR &= ~TIM_SMCR_TS;
1884  htim->Instance->SMCR |= InputTrigger;
1885  }
1886 
1887  /* Select the Capture Compare preload feature */
1888  htim->Instance->CR2 |= TIM_CR2_CCPC;
1889  /* Select the Commutation event source */
1890  htim->Instance->CR2 &= ~TIM_CR2_CCUS;
1891  htim->Instance->CR2 |= CommutationSource;
1892 
1893  /* Enable the Commutation DMA Request */
1894  /* Set the DMA Commutation Callback */
1897  /* Set the DMA error callback */
1899 
1900  /* Disable Commutation Interrupt */
1902 
1903  /* Enable the Commutation DMA Request */
1905 
1906  __HAL_UNLOCK(htim);
1907 
1908  return HAL_OK;
1909 }
1910 
1920  TIM_MasterConfigTypeDef *sMasterConfig)
1921 {
1922  uint32_t tmpcr2;
1923  uint32_t tmpsmcr;
1924 
1925  /* Check the parameters */
1929 
1930  /* Check input state */
1931  __HAL_LOCK(htim);
1932 
1933  /* Change the handler state */
1934  htim->State = HAL_TIM_STATE_BUSY;
1935 
1936  /* Get the TIMx CR2 register value */
1937  tmpcr2 = htim->Instance->CR2;
1938 
1939  /* Get the TIMx SMCR register value */
1940  tmpsmcr = htim->Instance->SMCR;
1941 
1942  /* If the timer supports ADC synchronization through TRGO2, set the master mode selection 2 */
1943  if (IS_TIM_TRGO2_INSTANCE(htim->Instance))
1944  {
1945  /* Check the parameters */
1947 
1948  /* Clear the MMS2 bits */
1949  tmpcr2 &= ~TIM_CR2_MMS2;
1950  /* Select the TRGO2 source*/
1951  tmpcr2 |= sMasterConfig->MasterOutputTrigger2;
1952  }
1953 
1954  /* Reset the MMS Bits */
1955  tmpcr2 &= ~TIM_CR2_MMS;
1956  /* Select the TRGO source */
1957  tmpcr2 |= sMasterConfig->MasterOutputTrigger;
1958 
1959  /* Update TIMx CR2 */
1960  htim->Instance->CR2 = tmpcr2;
1961 
1962  if (IS_TIM_SLAVE_INSTANCE(htim->Instance))
1963  {
1964  /* Reset the MSM Bit */
1965  tmpsmcr &= ~TIM_SMCR_MSM;
1966  /* Set master mode */
1967  tmpsmcr |= sMasterConfig->MasterSlaveMode;
1968 
1969  /* Update TIMx SMCR */
1970  htim->Instance->SMCR = tmpsmcr;
1971  }
1972 
1973  /* Change the htim state */
1974  htim->State = HAL_TIM_STATE_READY;
1975 
1976  __HAL_UNLOCK(htim);
1977 
1978  return HAL_OK;
1979 }
1980 
1993  TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig)
1994 {
1995  /* Keep this variable initialized to 0 as it is used to configure BDTR register */
1996  uint32_t tmpbdtr = 0U;
1997 
1998  /* Check the parameters */
2000  assert_param(IS_TIM_OSSR_STATE(sBreakDeadTimeConfig->OffStateRunMode));
2001  assert_param(IS_TIM_OSSI_STATE(sBreakDeadTimeConfig->OffStateIDLEMode));
2002  assert_param(IS_TIM_LOCK_LEVEL(sBreakDeadTimeConfig->LockLevel));
2003  assert_param(IS_TIM_DEADTIME(sBreakDeadTimeConfig->DeadTime));
2004  assert_param(IS_TIM_BREAK_STATE(sBreakDeadTimeConfig->BreakState));
2005  assert_param(IS_TIM_BREAK_POLARITY(sBreakDeadTimeConfig->BreakPolarity));
2006  assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->BreakFilter));
2008 
2009  /* Check input state */
2010  __HAL_LOCK(htim);
2011 
2012  /* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State,
2013  the OSSI State, the dead time value and the Automatic Output Enable Bit */
2014 
2015  /* Set the BDTR bits */
2016  MODIFY_REG(tmpbdtr, TIM_BDTR_DTG, sBreakDeadTimeConfig->DeadTime);
2017  MODIFY_REG(tmpbdtr, TIM_BDTR_LOCK, sBreakDeadTimeConfig->LockLevel);
2018  MODIFY_REG(tmpbdtr, TIM_BDTR_OSSI, sBreakDeadTimeConfig->OffStateIDLEMode);
2019  MODIFY_REG(tmpbdtr, TIM_BDTR_OSSR, sBreakDeadTimeConfig->OffStateRunMode);
2020  MODIFY_REG(tmpbdtr, TIM_BDTR_BKE, sBreakDeadTimeConfig->BreakState);
2021  MODIFY_REG(tmpbdtr, TIM_BDTR_BKP, sBreakDeadTimeConfig->BreakPolarity);
2022  MODIFY_REG(tmpbdtr, TIM_BDTR_AOE, sBreakDeadTimeConfig->AutomaticOutput);
2023  MODIFY_REG(tmpbdtr, TIM_BDTR_BKF, (sBreakDeadTimeConfig->BreakFilter << TIM_BDTR_BKF_Pos));
2024 
2025  if (IS_TIM_BKIN2_INSTANCE(htim->Instance))
2026  {
2027  /* Check the parameters */
2028  assert_param(IS_TIM_BREAK2_STATE(sBreakDeadTimeConfig->Break2State));
2029  assert_param(IS_TIM_BREAK2_POLARITY(sBreakDeadTimeConfig->Break2Polarity));
2030  assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->Break2Filter));
2031 
2032  /* Set the BREAK2 input related BDTR bits */
2033  MODIFY_REG(tmpbdtr, TIM_BDTR_BK2F, (sBreakDeadTimeConfig->Break2Filter << TIM_BDTR_BK2F_Pos));
2034  MODIFY_REG(tmpbdtr, TIM_BDTR_BK2E, sBreakDeadTimeConfig->Break2State);
2035  MODIFY_REG(tmpbdtr, TIM_BDTR_BK2P, sBreakDeadTimeConfig->Break2Polarity);
2036  }
2037 
2038  /* Set TIMx_BDTR */
2039  htim->Instance->BDTR = tmpbdtr;
2040 
2041  __HAL_UNLOCK(htim);
2042 
2043  return HAL_OK;
2044 }
2045 #if defined(TIM_BREAK_INPUT_SUPPORT)
2046 
2057 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim,
2058  uint32_t BreakInput,
2059  TIMEx_BreakInputConfigTypeDef *sBreakInputConfig)
2060 
2061 {
2062  uint32_t tmporx;
2063  uint32_t bkin_enable_mask;
2064  uint32_t bkin_polarity_mask;
2065  uint32_t bkin_enable_bitpos;
2066  uint32_t bkin_polarity_bitpos;
2067 
2068  /* Check the parameters */
2070  assert_param(IS_TIM_BREAKINPUT(BreakInput));
2071  assert_param(IS_TIM_BREAKINPUTSOURCE(sBreakInputConfig->Source));
2072  assert_param(IS_TIM_BREAKINPUTSOURCE_STATE(sBreakInputConfig->Enable));
2073  if (sBreakInputConfig->Source != TIM_BREAKINPUTSOURCE_DFSDM1)
2074  {
2075  assert_param(IS_TIM_BREAKINPUTSOURCE_POLARITY(sBreakInputConfig->Polarity));
2076  }
2077 
2078  /* Check input state */
2079  __HAL_LOCK(htim);
2080 
2081  switch (sBreakInputConfig->Source)
2082  {
2083  case TIM_BREAKINPUTSOURCE_BKIN:
2084  {
2085  bkin_enable_mask = TIM1_AF1_BKINE;
2086  bkin_enable_bitpos = TIM1_AF1_BKINE_Pos;
2087  bkin_polarity_mask = TIM1_AF1_BKINP;
2088  bkin_polarity_bitpos = TIM1_AF1_BKINP_Pos;
2089  break;
2090  }
2091  case TIM_BREAKINPUTSOURCE_COMP1:
2092  {
2093  bkin_enable_mask = TIM1_AF1_BKCMP1E;
2094  bkin_enable_bitpos = TIM1_AF1_BKCMP1E_Pos;
2095  bkin_polarity_mask = TIM1_AF1_BKCMP1P;
2096  bkin_polarity_bitpos = TIM1_AF1_BKCMP1P_Pos;
2097  break;
2098  }
2099  case TIM_BREAKINPUTSOURCE_COMP2:
2100  {
2101  bkin_enable_mask = TIM1_AF1_BKCMP2E;
2102  bkin_enable_bitpos = TIM1_AF1_BKCMP2E_Pos;
2103  bkin_polarity_mask = TIM1_AF1_BKCMP2P;
2104  bkin_polarity_bitpos = TIM1_AF1_BKCMP2P_Pos;
2105  break;
2106  }
2107  case TIM_BREAKINPUTSOURCE_DFSDM1:
2108  {
2109  bkin_enable_mask = TIM1_AF1_BKDF1BK0E;
2110  bkin_enable_bitpos = 8U;
2111  bkin_polarity_mask = 0U;
2112  bkin_polarity_bitpos = 0U;
2113  break;
2114  }
2115 
2116  default:
2117  {
2118  bkin_enable_mask = 0U;
2119  bkin_polarity_mask = 0U;
2120  bkin_enable_bitpos = 0U;
2121  bkin_polarity_bitpos = 0U;
2122  break;
2123  }
2124  }
2125 
2126  switch (BreakInput)
2127  {
2128  case TIM_BREAKINPUT_BRK:
2129  {
2130  /* Get the TIMx_AF1 register value */
2131  tmporx = htim->Instance->AF1;
2132 
2133  /* Enable the break input */
2134  tmporx &= ~bkin_enable_mask;
2135  tmporx |= (sBreakInputConfig->Enable << bkin_enable_bitpos) & bkin_enable_mask;
2136 
2137  /* Set the break input polarity */
2138  if (sBreakInputConfig->Source != TIM_BREAKINPUTSOURCE_DFSDM1)
2139  {
2140  tmporx &= ~bkin_polarity_mask;
2141  tmporx |= (sBreakInputConfig->Polarity << bkin_polarity_bitpos) & bkin_polarity_mask;
2142  }
2143 
2144  /* Set TIMx_AF1 */
2145  htim->Instance->AF1 = tmporx;
2146  break;
2147  }
2148  case TIM_BREAKINPUT_BRK2:
2149  {
2150  /* Get the TIMx_AF2 register value */
2151  tmporx = htim->Instance->AF2;
2152 
2153  /* Enable the break input */
2154  tmporx &= ~bkin_enable_mask;
2155  tmporx |= (sBreakInputConfig->Enable << bkin_enable_bitpos) & bkin_enable_mask;
2156 
2157  /* Set the break input polarity */
2158  if (sBreakInputConfig->Source != TIM_BREAKINPUTSOURCE_DFSDM1)
2159  {
2160  tmporx &= ~bkin_polarity_mask;
2161  tmporx |= (sBreakInputConfig->Polarity << bkin_polarity_bitpos) & bkin_polarity_mask;
2162  }
2163 
2164  /* Set TIMx_AF2 */
2165  htim->Instance->AF2 = tmporx;
2166  break;
2167  }
2168  default:
2169  break;
2170  }
2171 
2172  __HAL_UNLOCK(htim);
2173 
2174  return HAL_OK;
2175 }
2176 #endif /*TIM_BREAK_INPUT_SUPPORT */
2177 
2240 {
2241  /* Check parameters */
2243  assert_param(IS_TIM_REMAP(Remap));
2244 
2245  __HAL_LOCK(htim);
2246 
2247  MODIFY_REG(htim->Instance->AF1, TIM1_AF1_ETRSEL_Msk, Remap);
2248 
2249  __HAL_UNLOCK(htim);
2250 
2251  return HAL_OK;
2252 }
2253 
2333 HAL_StatusTypeDef HAL_TIMEx_TISelection(TIM_HandleTypeDef *htim, uint32_t TISelection, uint32_t Channel)
2334 {
2335  HAL_StatusTypeDef status = HAL_OK;
2336 
2337  /* Check parameters */
2339  assert_param(IS_TIM_TISEL(TISelection));
2340 
2341  __HAL_LOCK(htim);
2342 
2343  switch (Channel)
2344  {
2345  case TIM_CHANNEL_1:
2346  MODIFY_REG(htim->Instance->TISEL, TIM_TISEL_TI1SEL, TISelection);
2347  break;
2348  case TIM_CHANNEL_2:
2349  MODIFY_REG(htim->Instance->TISEL, TIM_TISEL_TI2SEL, TISelection);
2350  break;
2351  case TIM_CHANNEL_3:
2352  MODIFY_REG(htim->Instance->TISEL, TIM_TISEL_TI3SEL, TISelection);
2353  break;
2354  case TIM_CHANNEL_4:
2355  MODIFY_REG(htim->Instance->TISEL, TIM_TISEL_TI4SEL, TISelection);
2356  break;
2357  default:
2358  status = HAL_ERROR;
2359  break;
2360  }
2361 
2362  __HAL_UNLOCK(htim);
2363 
2364  return status;
2365 }
2366 
2379 {
2380  /* Check parameters */
2382  assert_param(IS_TIM_GROUPCH5(Channels));
2383 
2384  /* Process Locked */
2385  __HAL_LOCK(htim);
2386 
2387  htim->State = HAL_TIM_STATE_BUSY;
2388 
2389  /* Clear GC5Cx bit fields */
2391 
2392  /* Set GC5Cx bit fields */
2393  htim->Instance->CCR5 |= Channels;
2394 
2395  /* Change the htim state */
2396  htim->State = HAL_TIM_STATE_READY;
2397 
2398  __HAL_UNLOCK(htim);
2399 
2400  return HAL_OK;
2401 }
2402 
2429 {
2430  /* Prevent unused argument(s) compilation warning */
2431  UNUSED(htim);
2432 
2433  /* NOTE : This function should not be modified, when the callback is needed,
2434  the HAL_TIMEx_CommutCallback could be implemented in the user file
2435  */
2436 }
2443 {
2444  /* Prevent unused argument(s) compilation warning */
2445  UNUSED(htim);
2446 
2447  /* NOTE : This function should not be modified, when the callback is needed,
2448  the HAL_TIMEx_CommutHalfCpltCallback could be implemented in the user file
2449  */
2450 }
2451 
2457 __weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim)
2458 {
2459  /* Prevent unused argument(s) compilation warning */
2460  UNUSED(htim);
2461 
2462  /* NOTE : This function should not be modified, when the callback is needed,
2463  the HAL_TIMEx_BreakCallback could be implemented in the user file
2464  */
2465 }
2466 
2473 {
2474  /* Prevent unused argument(s) compilation warning */
2475  UNUSED(htim);
2476 
2477  /* NOTE : This function Should not be modified, when the callback is needed,
2478  the HAL_TIMEx_Break2Callback could be implemented in the user file
2479  */
2480 }
2506 {
2507  return htim->State;
2508 }
2509 
2521 {
2522  HAL_TIM_ChannelStateTypeDef channel_state;
2523 
2524  /* Check the parameters */
2525  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, ChannelN));
2526 
2527  channel_state = TIM_CHANNEL_N_STATE_GET(htim, ChannelN);
2528 
2529  return channel_state;
2530 }
2539 /* Private functions ---------------------------------------------------------*/
2550 {
2551  TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
2552 
2553  /* Change the htim state */
2554  htim->State = HAL_TIM_STATE_READY;
2555 
2556 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2557  htim->CommutationCallback(htim);
2558 #else
2560 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
2561 }
2562 
2569 {
2570  TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
2571 
2572  /* Change the htim state */
2573  htim->State = HAL_TIM_STATE_READY;
2574 
2575 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2576  htim->CommutationHalfCpltCallback(htim);
2577 #else
2579 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
2580 }
2581 
2582 
2588 static void TIM_DMADelayPulseNCplt(DMA_HandleTypeDef *hdma)
2589 {
2590  TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
2591 
2592  if (hdma == htim->hdma[TIM_DMA_ID_CC1])
2593  {
2595 
2596  if (hdma->Init.Mode == DMA_NORMAL)
2597  {
2599  }
2600  }
2601  else if (hdma == htim->hdma[TIM_DMA_ID_CC2])
2602  {
2604 
2605  if (hdma->Init.Mode == DMA_NORMAL)
2606  {
2608  }
2609  }
2610  else if (hdma == htim->hdma[TIM_DMA_ID_CC3])
2611  {
2613 
2614  if (hdma->Init.Mode == DMA_NORMAL)
2615  {
2617  }
2618  }
2619  else if (hdma == htim->hdma[TIM_DMA_ID_CC4])
2620  {
2622 
2623  if (hdma->Init.Mode == DMA_NORMAL)
2624  {
2626  }
2627  }
2628  else
2629  {
2630  /* nothing to do */
2631  }
2632 
2633 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2634  htim->PWM_PulseFinishedCallback(htim);
2635 #else
2637 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
2638 
2640 }
2641 
2647 static void TIM_DMAErrorCCxN(DMA_HandleTypeDef *hdma)
2648 {
2649  TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
2650 
2651  if (hdma == htim->hdma[TIM_DMA_ID_CC1])
2652  {
2655  }
2656  else if (hdma == htim->hdma[TIM_DMA_ID_CC2])
2657  {
2660  }
2661  else if (hdma == htim->hdma[TIM_DMA_ID_CC3])
2662  {
2665  }
2666  else
2667  {
2668  /* nothing to do */
2669  }
2670 
2671 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2672  htim->ErrorCallback(htim);
2673 #else
2674  HAL_TIM_ErrorCallback(htim);
2675 #endif /* USE_HAL_TIM_REGISTER_CALLBACKS */
2676 
2678 }
2679 
2692 static void TIM_CCxNChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelNState)
2693 {
2694  uint32_t tmp;
2695 
2696  tmp = TIM_CCER_CC1NE << (Channel & 0x1FU); /* 0x1FU = 31 bits max shift */
2697 
2698  /* Reset the CCxNE Bit */
2699  TIMx->CCER &= ~tmp;
2700 
2701  /* Set or reset the CCxNE Bit */
2702  TIMx->CCER |= (uint32_t)(ChannelNState << (Channel & 0x1FU)); /* 0x1FU = 31 bits max shift */
2703 }
2708 #endif /* HAL_TIM_MODULE_ENABLED */
2709 
2717 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
HAL_TIMEx_PWMN_Start
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
IS_TIM_IC_FILTER
#define IS_TIM_IC_FILTER(__ICFILTER__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1732
TIM_BDTR_BK2F_Pos
#define TIM_BDTR_BK2F_Pos
Definition: stm32f769xx.h:14883
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
IS_TIM_INSTANCE
#define IS_TIM_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15161
HAL_TIMEx_RemapConfig
HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap)
TIM_OC_InitTypeDef::Pulse
uint32_t Pulse
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:83
TIM_OC_InitTypeDef::OCFastMode
uint32_t OCFastMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:93
TIM1_AF1_BKCMP2P
#define TIM1_AF1_BKCMP2P
Definition: stm32h735xx.h:20368
TIM_IT_CC3
#define TIM_IT_CC3
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:653
TIM_OCPOLARITY_HIGH
#define TIM_OCPOLARITY_HIGH
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:553
TIM_SMCR_SMS
#define TIM_SMCR_SMS
Definition: stm32f407xx.h:11978
TIM_MasterConfigTypeDef::MasterOutputTrigger
uint32_t MasterOutputTrigger
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:231
TIM_OC_InitTypeDef::OCMode
uint32_t OCMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:80
TIM_TISEL_TI4SEL
#define TIM_TISEL_TI4SEL
Definition: stm32h735xx.h:20428
TIM_DMACaptureHalfCplt
void TIM_DMACaptureHalfCplt(DMA_HandleTypeDef *hdma)
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
TIM_CHANNEL_N_STATE_SET
#define TIM_CHANNEL_N_STATE_SET(__HANDLE__, __CHANNEL__, __CHANNEL_STATE__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:2089
TIM_TISEL_TI3SEL
#define TIM_TISEL_TI3SEL
Definition: stm32h735xx.h:20420
HAL_TIMEx_HallSensor_MspDeInit
void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim)
IS_TIM_BREAK_STATE
#define IS_TIM_BREAK_STATE(__STATE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1645
IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION
#define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(__SELECTION__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1691
HAL_TIMEx_PWMN_Start_DMA
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
HAL_TIMEx_OCN_Stop_DMA
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
IS_TIM_DEADTIME
#define IS_TIM_DEADTIME(__DEADTIME__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1734
IS_TIM_OSSI_STATE
#define IS_TIM_OSSI_STATE(__STATE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1634
HAL_TIMEx_CommutHalfCpltCallback
void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim)
TIM1_AF1_BKCMP1E
#define TIM1_AF1_BKCMP1E
Definition: stm32h735xx.h:20353
TIM_BreakDeadTimeConfigTypeDef::BreakState
uint32_t BreakState
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:275
__DMA_HandleTypeDef::XferHalfCpltCallback
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:153
__DMA_HandleTypeDef
DMA handle Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:139
NULL
#define NULL
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/speex_resampler/thirdparty/resample.c:92
TIM_CCxChannelCmd
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
HAL_TIMEx_OnePulseN_Stop_IT
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
HAL_TIMEx_BreakCallback
void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim)
TIM_CHANNEL_1
#define TIM_CHANNEL_1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:707
__HAL_TIM_DISABLE
#define __HAL_TIM_DISABLE(__HANDLE__)
Disable the TIM peripheral.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1036
HAL_TIMEx_HallSensor_MspInit
void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim)
TIM1_AF1_BKCMP2E
#define TIM1_AF1_BKCMP2E
Definition: stm32h735xx.h:20356
IS_TIM_IC_POLARITY
#define IS_TIM_IC_POLARITY(__POLARITY__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1562
__HAL_TIM_ENABLE_DMA
#define __HAL_TIM_ENABLE_DMA(__HANDLE__, __DMA__)
Enable the specified DMA request.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1117
TIM_TS_ITR1
#define TIM_TS_ITR1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:887
HAL_UNLOCKED
@ HAL_UNLOCKED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:53
TIM_TypeDef::BDTR
__IO uint32_t BDTR
Definition: stm32f407xx.h:748
TIM_CCER_CC3NE
#define TIM_CCER_CC3NE
Definition: stm32f407xx.h:12317
TIM_CHANNEL_2
#define TIM_CHANNEL_2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:708
TIM_TypeDef::CCR5
__IO uint32_t CCR5
Definition: stm32f769xx.h:979
HAL_TIMEx_ConfigCommutEvent
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
TIM_DMA_ID_CC3
#define TIM_DMA_ID_CC3
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:962
TIM_CCxN_ENABLE
#define TIM_CCxN_ENABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:975
TIM_HandleTypeDef::DMABurstState
__IO HAL_TIM_DMABurstStateTypeDef DMABurstState
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:359
HAL_DMA_Abort_IT
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
TIM_Base_InitTypeDef::CounterMode
uint32_t CounterMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:52
__HAL_TIM_MOE_ENABLE
#define __HAL_TIM_MOE_ENABLE(__HANDLE__)
Enable the TIM main Output.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1029
HAL_TIM_CHANNEL_STATE_READY
@ HAL_TIM_CHANNEL_STATE_READY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:313
HAL_TIMEx_HallSensor_Start_IT
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim)
TIM_OCNPOLARITY_HIGH
#define TIM_OCNPOLARITY_HIGH
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:562
TIMEx_DMACommutationCplt
void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma)
TIM_OC_InitTypeDef::OCNPolarity
uint32_t OCNPolarity
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:89
__HAL_TIM_DISABLE_DMA
#define __HAL_TIM_DISABLE_DMA(__HANDLE__, __DMA__)
Disable the specified DMA request.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1132
TIM_TypeDef::AF1
__IO uint32_t AF1
Definition: stm32f769xx.h:981
IS_TIM_TRGO2_SOURCE
#define IS_TIM_TRGO2_SOURCE(__SOURCE__)
Definition: stm32f7xx_hal_tim.h:1874
TIM_MasterConfigTypeDef::MasterOutputTrigger2
uint32_t MasterOutputTrigger2
Definition: stm32f7xx_hal_tim.h:235
IS_TIM_COUNTER_MODE
#define IS_TIM_COUNTER_MODE(__MODE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1531
TIM1_AF1_BKCMP1E_Pos
#define TIM1_AF1_BKCMP1E_Pos
Definition: stm32h735xx.h:20351
TIM_CR2_CCPC
#define TIM_CR2_CCPC
Definition: stm32f407xx.h:11935
HAL_TIM_ACTIVE_CHANNEL_3
@ HAL_TIM_ACTIVE_CHANNEL_3
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:304
__DMA_HandleTypeDef::Init
DMA_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:143
IS_TIM_BKIN2_INSTANCE
#define IS_TIM_BKIN2_INSTANCE(INSTANCE)
Definition: stm32f769xx.h:21663
IS_TIM_TRGO_SOURCE
#define IS_TIM_TRGO_SOURCE(__SOURCE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1654
TIM_DMA_CC3
#define TIM_DMA_CC3
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:677
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
TIM_CR2_MMS2
#define TIM_CR2_MMS2
Definition: stm32f769xx.h:14378
TIM_ICSELECTION_TRC
#define TIM_ICSELECTION_TRC
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:612
TIM_OC_InitTypeDef::OCIdleState
uint32_t OCIdleState
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:98
IS_TIM_COMBINED3PHASEPWM_INSTANCE
#define IS_TIM_COMBINED3PHASEPWM_INSTANCE(__INSTANCE__)
Definition: stm32f769xx.h:21745
TIM_CHANNEL_3
#define TIM_CHANNEL_3
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:709
TIM_DMAError
void TIM_DMAError(DMA_HandleTypeDef *hdma)
IS_TIM_REMAP_INSTANCE
#define IS_TIM_REMAP_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15294
TIM_DMA_CC2
#define TIM_DMA_CC2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:676
TIM_MasterConfigTypeDef::MasterSlaveMode
uint32_t MasterSlaveMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:233
HAL_TIMEx_PWMN_Start_IT
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_TIM_CHANNEL_STATE_BUSY
@ HAL_TIM_CHANNEL_STATE_BUSY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:314
TIM_OCIDLESTATE_RESET
#define TIM_OCIDLESTATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:572
TIM_Base_InitTypeDef::ClockDivision
uint32_t ClockDivision
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:59
IS_TIM_BREAK_POLARITY
#define IS_TIM_BREAK_POLARITY(__POLARITY__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1648
TIM_TypeDef::CCER
__IO uint32_t CCER
Definition: stm32f407xx.h:739
HAL_TIMEx_OnePulseN_Start
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
HAL_TIMEx_OCN_Stop_IT
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_TIMEx_ConfigCommutEvent_IT
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
TIM_TypeDef::CR2
__IO uint32_t CR2
Definition: stm32f407xx.h:732
IS_TIM_LOCK_LEVEL
#define IS_TIM_LOCK_LEVEL(__LEVEL__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1637
TIM_TS_ITR13
#define TIM_TS_ITR13
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:1028
HAL_DMA_BURST_STATE_RESET
@ HAL_DMA_BURST_STATE_RESET
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:322
TIM_IT_CC1
#define TIM_IT_CC1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:651
HAL_TIMEx_Break2Callback
void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim)
HAL_TIM_ErrorCallback
void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim)
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
TIM_DMA_CC1
#define TIM_DMA_CC1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:675
IS_TIM_SLAVEMODE_TRIGGER_ENABLED
#define IS_TIM_SLAVEMODE_TRIGGER_ENABLED(__TRIGGER__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1736
TIM_BreakDeadTimeConfigTypeDef::Break2Polarity
uint32_t Break2Polarity
Definition: stm32f7xx_hal_tim.h:287
IS_TIM_SLAVE_INSTANCE
#define IS_TIM_SLAVE_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15273
TIM_HallSensor_InitTypeDef::IC1Filter
uint32_t IC1Filter
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:56
TIM_DMA_ID_COMMUTATION
#define TIM_DMA_ID_COMMUTATION
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:964
TIM_HallSensor_InitTypeDef::IC1Prescaler
uint32_t IC1Prescaler
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:53
IS_TIM_BREAK_FILTER
#define IS_TIM_BREAK_FILTER(__BRKFILTER__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1642
TIM1_AF1_BKCMP1P_Pos
#define TIM1_AF1_BKCMP1P_Pos
Definition: stm32h735xx.h:20363
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
HAL_TIMEx_OnePulseN_Stop
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
TIM_SMCR_MSM
#define TIM_SMCR_MSM
Definition: stm32f407xx.h:11992
TIM_DMA_ID_CC2
#define TIM_DMA_ID_CC2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:961
TIM_OCFAST_DISABLE
#define TIM_OCFAST_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:535
TIM_TypeDef::SMCR
__IO uint32_t SMCR
Definition: stm32f407xx.h:733
TIM_TypeDef::CCR3
__IO uint32_t CCR3
Definition: stm32f407xx.h:746
TIM_TypeDef
TIM.
Definition: stm32f407xx.h:729
TIM_HallSensor_InitTypeDef
TIM Hall sensor Configuration Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:48
IS_TIM_AUTOMATIC_OUTPUT_STATE
#define IS_TIM_AUTOMATIC_OUTPUT_STATE(__STATE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1651
TIM_BreakDeadTimeConfigTypeDef::AutomaticOutput
uint32_t AutomaticOutput
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:281
TIM_IT_COM
#define TIM_IT_COM
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:655
HAL_TIMEx_PWMN_Stop_IT
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_TIMEx_PWMN_Stop
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
__HAL_TIM_ENABLE
#define __HAL_TIM_ENABLE(__HANDLE__)
Enable the TIM peripheral.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1022
__HAL_TIM_DISABLE_IT
#define __HAL_TIM_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the specified TIM interrupt.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1102
TIM_HandleTypeDef::Instance
TIM_TypeDef * Instance
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:318
TIM_BDTR_BKF
#define TIM_BDTR_BKF
Definition: stm32f769xx.h:14882
TIM_CCER_CC2NE
#define TIM_CCER_CC2NE
Definition: stm32f407xx.h:12305
TIM_TISEL_TI2SEL
#define TIM_TISEL_TI2SEL
Definition: stm32h735xx.h:20412
HAL_TIMEx_OCN_Stop
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
TIM_DMA_ID_CC1
#define TIM_DMA_ID_CC1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:960
TIM1_AF1_BKINE
#define TIM1_AF1_BKINE
Definition: stm32f769xx.h:15009
TIM1_AF1_BKCMP2P_Pos
#define TIM1_AF1_BKCMP2P_Pos
Definition: stm32h735xx.h:20366
TIM1_AF1_ETRSEL_Msk
#define TIM1_AF1_ETRSEL_Msk
Definition: stm32h735xx.h:20371
TIM_CR2_MMS
#define TIM_CR2_MMS
Definition: stm32f407xx.h:11945
HAL_TIM_ACTIVE_CHANNEL_2
@ HAL_TIM_ACTIVE_CHANNEL_2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:303
TIM1_AF1_BKDF1BK0E
#define TIM1_AF1_BKDF1BK0E
Definition: stm32h735xx.h:20359
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
HAL_TIM_STATE_RESET
@ HAL_TIM_STATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:290
HAL_TIMEx_OCN_Start
HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
TIM1_AF1_BKINP_Pos
#define TIM1_AF1_BKINP_Pos
Definition: stm32f769xx.h:15013
TIM_CHANNEL_N_STATE_GET
#define TIM_CHANNEL_N_STATE_GET(__HANDLE__, __CHANNEL__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:2083
TIM_OC_InitTypeDef
TIM Output Compare Configuration Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:78
MODIFY_REG
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:224
TIM_CCx_ENABLE
#define TIM_CCx_ENABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:973
TIM_IT_CC2
#define TIM_IT_CC2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:652
IS_TIM_TRGO2_INSTANCE
#define IS_TIM_TRGO2_INSTANCE(__INSTANCE__)
Definition: stm32f769xx.h:21910
TIM_HandleTypeDef
TIM Time Base Handle Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:315
TIM_BDTR_OSSI
#define TIM_BDTR_OSSI
Definition: stm32f407xx.h:12392
TIM_TISEL_TI1SEL
#define TIM_TISEL_TI1SEL
Definition: stm32h735xx.h:20404
HAL_TIMEx_HallSensor_Stop_DMA
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim)
RESET
@ RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:187
TIM_BreakDeadTimeConfigTypeDef::OffStateIDLEMode
uint32_t OffStateIDLEMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:269
TIM_HandleTypeDef::Channel
HAL_TIM_ActiveChannel Channel
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:320
HAL_TIM_PWM_PulseFinishedCallback
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
HAL_BUSY
@ HAL_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:44
HAL_DMA_Start_IT
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
IS_TIM_TISEL
#define IS_TIM_TISEL(__TISEL__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h:277
TIM_CCR5_GC5C3
#define TIM_CCR5_GC5C3
Definition: stm32f769xx.h:15001
HAL_TIMEx_HallSensor_Start_DMA
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length)
TIM_CR2_CCUS
#define TIM_CR2_CCUS
Definition: stm32f407xx.h:11938
TIM_BreakDeadTimeConfigTypeDef::Break2State
uint32_t Break2State
Definition: stm32f7xx_hal_tim.h:285
HAL_TIMEx_TISelection
HAL_StatusTypeDef HAL_TIMEx_TISelection(TIM_HandleTypeDef *htim, uint32_t TISelection, uint32_t Channel)
HAL_TIMEx_HallSensor_Init
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef *sConfig)
__HAL_UNLOCK
#define __HAL_UNLOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:105
TIM_Base_InitTypeDef::AutoReloadPreload
uint32_t AutoReloadPreload
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:71
TIM_CCxN_DISABLE
#define TIM_CCxN_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:976
HAL_TIM_StateTypeDef
HAL_TIM_StateTypeDef
HAL State structures definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:288
TIM_DMA_ID_CC4
#define TIM_DMA_ID_CC4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:963
HAL_TIM_ChannelStateTypeDef
HAL_TIM_ChannelStateTypeDef
TIM Channel States definition.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:310
HAL_TIMEx_HallSensor_Stop
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim)
TIM_BreakDeadTimeConfigTypeDef::DeadTime
uint32_t DeadTime
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:273
TIM_TypeDef::TISEL
__IO uint32_t TISEL
Definition: stm32h735xx.h:1557
HAL_DMA_BURST_STATE_READY
@ HAL_DMA_BURST_STATE_READY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:323
TIM1_AF1_BKINE_Pos
#define TIM1_AF1_BKINE_Pos
Definition: stm32f769xx.h:15007
TIM_Base_SetConfig
void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure)
HAL_TIMEx_CommutCallback
void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim)
HAL_TIM_ACTIVE_CHANNEL_CLEARED
@ HAL_TIM_ACTIVE_CHANNEL_CLEARED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:306
TIM_CCR5_GC5C2
#define TIM_CCR5_GC5C2
Definition: stm32f769xx.h:14998
IS_TIM_BREAK2_STATE
#define IS_TIM_BREAK2_STATE(__STATE__)
Definition: stm32f7xx_hal_tim.h:1854
TIM_HallSensor_InitTypeDef::IC1Polarity
uint32_t IC1Polarity
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:50
TIM_CCx_DISABLE
#define TIM_CCx_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:974
TIM_CR2_TI1S
#define TIM_CR2_TI1S
Definition: stm32f407xx.h:11952
TIM_CHANNEL_STATE_SET
#define TIM_CHANNEL_STATE_SET(__HANDLE__, __CHANNEL__, __CHANNEL_STATE__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:2066
IS_TIM_MASTER_INSTANCE
#define IS_TIM_MASTER_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15263
TIM_TRGO_OC2REF
#define TIM_TRGO_OC2REF
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:840
TIM_CHANNEL_4
#define TIM_CHANNEL_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:710
TIM_OC2_SetConfig
void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
TIM_DMADelayPulseHalfCplt
void TIM_DMADelayPulseHalfCplt(DMA_HandleTypeDef *hdma)
DMA_NORMAL
#define DMA_NORMAL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:281
IS_TIM_TISEL_INSTANCE
#define IS_TIM_TISEL_INSTANCE(INSTANCE)
Definition: stm32h735xx.h:24260
IS_TIM_BREAKINPUT
#define IS_TIM_BREAKINPUT(__BREAKINPUT__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h:263
HAL_TIMEx_PWMN_Stop_DMA
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_TIMEx_OnePulseN_Start_IT
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
HAL_TIMEx_OCN_Start_IT
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
TIM_BDTR_OSSR
#define TIM_BDTR_OSSR
Definition: stm32f407xx.h:12395
__DMA_HandleTypeDef::XferCpltCallback
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:151
TIM_TypeDef::CCMR1
__IO uint32_t CCMR1
Definition: stm32f407xx.h:737
IS_TIM_AUTORELOAD_PRELOAD
#define IS_TIM_AUTORELOAD_PRELOAD(PRELOAD)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1541
HAL_TIMEx_HallSensor_Start
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim)
TIM_MasterConfigTypeDef
TIM Master configuration Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:229
TIM_BDTR_BKE
#define TIM_BDTR_BKE
Definition: stm32f407xx.h:12398
TIM_TS_ITR3
#define TIM_TS_ITR3
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:889
TIM_CCER_CC1NE
#define TIM_CCER_CC1NE
Definition: stm32f407xx.h:12293
TIM_TS_ITR2
#define TIM_TS_ITR2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:888
HAL_TIMEx_MasterConfigSynchronization
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef *sMasterConfig)
IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE
#define IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15455
TIM_BDTR_AOE
#define TIM_BDTR_AOE
Definition: stm32f407xx.h:12404
TIM_BDTR_BKF_Pos
#define TIM_BDTR_BKF_Pos
Definition: stm32f769xx.h:14880
HAL_TIM_STATE_BUSY
@ HAL_TIM_STATE_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:292
IS_TIM_BREAKINPUTSOURCE
#define IS_TIM_BREAKINPUTSOURCE(__SOURCE__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h:266
IS_TIM_OSSR_STATE
#define IS_TIM_OSSR_STATE(__STATE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1631
TIM_BreakDeadTimeConfigTypeDef::BreakPolarity
uint32_t BreakPolarity
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:277
TIM1_AF1_BKINP
#define TIM1_AF1_BKINP
Definition: stm32f769xx.h:15015
IS_TIM_CCXN_INSTANCE
#define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL)
Definition: stm32f407xx.h:15357
HAL_TIM_CHANNEL_STATE_RESET
@ HAL_TIM_CHANNEL_STATE_RESET
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:312
__HAL_TIM_ENABLE_IT
#define __HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the specified TIM interrupt.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1086
TIM_HandleTypeDef::Init
TIM_Base_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:319
TIM_TypeDef::CCR1
__IO uint32_t CCR1
Definition: stm32f407xx.h:744
TIM_DMACaptureCplt
void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma)
TIM_HandleTypeDef::Lock
HAL_LockTypeDef Lock
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:323
TIM_BreakDeadTimeConfigTypeDef::Break2Filter
uint32_t Break2Filter
Definition: stm32f7xx_hal_tim.h:289
TIM_BDTR_BKP
#define TIM_BDTR_BKP
Definition: stm32f407xx.h:12401
IS_TIM_COMMUTATION_EVENT_INSTANCE
#define IS_TIM_COMMUTATION_EVENT_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15391
HAL_TIMEx_GetChannelNState
HAL_TIM_ChannelStateTypeDef HAL_TIMEx_GetChannelNState(TIM_HandleTypeDef *htim, uint32_t ChannelN)
TIM_CHANNEL_STATE_GET
#define TIM_CHANNEL_STATE_GET(__HANDLE__, __CHANNEL__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:2058
TIM_IT_BREAK
#define TIM_IT_BREAK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:657
HAL_TIMEx_HallSensor_GetState
HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim)
TIM1_AF1_BKCMP1P
#define TIM1_AF1_BKCMP1P
Definition: stm32h735xx.h:20365
IS_TIM_MSM_STATE
#define IS_TIM_MSM_STATE(__STATE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1663
TIM_CCMR1_IC1PSC
#define TIM_CCMR1_IC1PSC
Definition: stm32f407xx.h:12179
TIM_SLAVEMODE_RESET
#define TIM_SLAVEMODE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:860
TIM_TS_ITR12
#define TIM_TS_ITR12
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim.h:1027
IS_TIM_BREAK2_POLARITY
#define IS_TIM_BREAK2_POLARITY(__POLARITY__)
Definition: stm32f7xx_hal_tim.h:1857
TIM_OCMODE_PWM2
#define TIM_OCMODE_PWM2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:876
HAL_TIMEx_ConfigCommutEvent_DMA
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
TIM_BreakDeadTimeConfigTypeDef::LockLevel
uint32_t LockLevel
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:271
DMA_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:70
__HAL_TIM_MOE_DISABLE
#define __HAL_TIM_MOE_DISABLE(__HANDLE__)
Disable the TIM main Output.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1053
IS_TIM_BREAK_INSTANCE
#define IS_TIM_BREAK_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15462
IS_TIM_CLOCKDIVISION_DIV
#define IS_TIM_CLOCKDIVISION_DIV(__DIV__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1537
TIM_TypeDef::AF2
__IO uint32_t AF2
Definition: stm32f769xx.h:982
TIM_BreakDeadTimeConfigTypeDef::OffStateRunMode
uint32_t OffStateRunMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:267
TIM_OC_InitTypeDef::OCNIdleState
uint32_t OCNIdleState
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:102
TIM_BDTR_BK2F
#define TIM_BDTR_BK2F
Definition: stm32f769xx.h:14885
HAL_TIMEx_GroupChannel5
HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels)
IS_TIM_REMAP
#define IS_TIM_REMAP(INSTANCE, TIM_REMAP)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:185
TIM_OCNIDLESTATE_RESET
#define TIM_OCNIDLESTATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:581
TIMEx_DMACommutationHalfCplt
void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma)
TIM_TS_TI1F_ED
#define TIM_TS_TI1F_ED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:890
TIM_BreakDeadTimeConfigTypeDef::BreakFilter
uint32_t BreakFilter
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:279
TIM1_AF1_BKCMP2E_Pos
#define TIM1_AF1_BKCMP2E_Pos
Definition: stm32h735xx.h:20354
TIM_HandleTypeDef::hdma
DMA_HandleTypeDef * hdma[7]
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:321
IS_TIM_BREAKINPUTSOURCE_STATE
#define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h:271
HAL_TIMEx_HallSensor_DeInit
HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim)
TIM_HallSensor_InitTypeDef::Commutation_Delay
uint32_t Commutation_Delay
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h:59
IS_TIM_BREAKINPUTSOURCE_POLARITY
#define IS_TIM_BREAKINPUTSOURCE_POLARITY(__POLARITY__)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_tim_ex.h:274
TIM_HandleTypeDef::State
__IO HAL_TIM_StateTypeDef State
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:324
TIM_OC_InitTypeDef::OCPolarity
uint32_t OCPolarity
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:86
IS_TIM_IC_PRESCALER
#define IS_TIM_IC_PRESCALER(__PRESCALER__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:1570
TIM_BreakDeadTimeConfigTypeDef
TIM Break input(s) and Dead time configuration Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:265
TIM_BDTR_BK2E
#define TIM_BDTR_BK2E
Definition: stm32f769xx.h:14888
TIM_SMCR_TS
#define TIM_SMCR_TS
Definition: stm32f407xx.h:11985
TIM_BDTR_DTG
#define TIM_BDTR_DTG
Definition: stm32f407xx.h:12374
TIM_TypeDef::CCR2
__IO uint32_t CCR2
Definition: stm32f407xx.h:745
TIM_CCR5_GC5C1
#define TIM_CCR5_GC5C1
Definition: stm32f769xx.h:14995
TIM_DMA_COM
#define TIM_DMA_COM
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:679
TIM_BDTR_BK2P
#define TIM_BDTR_BK2P
Definition: stm32f769xx.h:14891
IS_TIM_GROUPCH5
#define IS_TIM_GROUPCH5(__OCREF__)
Definition: stm32f7xx_hal_tim.h:1863
HAL_TIM_STATE_READY
@ HAL_TIM_STATE_READY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:291
HAL_TIMEx_ConfigBreakDeadTime
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig)
TIM_TS_ITR0
#define TIM_TS_ITR0
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:886
__DMA_HandleTypeDef::XferErrorCallback
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:159
HAL_TIM_ACTIVE_CHANNEL_4
@ HAL_TIM_ACTIVE_CHANNEL_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:305
TIM_TI1_SetConfig
void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter)
HAL_TIM_ACTIVE_CHANNEL_1
@ HAL_TIM_ACTIVE_CHANNEL_1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h:302
HAL_TIMEx_OCN_Start_DMA
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
TIM_BDTR_LOCK
#define TIM_BDTR_LOCK
Definition: stm32f407xx.h:12386
HAL_TIMEx_HallSensor_Stop_IT
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim)


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