STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_tim_ex.c
Go to the documentation of this file.
1 
102 /* Includes ------------------------------------------------------------------*/
103 #include "stm32f7xx_hal.h"
104 
114 #ifdef HAL_TIM_MODULE_ENABLED
115 
116 /* Private typedef -----------------------------------------------------------*/
117 /* Private define ------------------------------------------------------------*/
118 #define BDTR_BKF_SHIFT (16)
119 #define BDTR_BK2F_SHIFT (20)
120 /* Private macro -------------------------------------------------------------*/
121 /* Private variables ---------------------------------------------------------*/
122 /* Private function prototypes -----------------------------------------------*/
126 static void TIM_CCxNChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelNState);
127 static void TIM_OC5_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config);
128 static void TIM_OC6_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config);
132 /* Private functions ---------------------------------------------------------*/
133 
167 {
168  TIM_OC_InitTypeDef OC_Config;
169 
170  /* Check the TIM handle allocation */
171  if(htim == NULL)
172  {
173  return HAL_ERROR;
174  }
175 
182 
183  /* Set the TIM state */
184  htim->State= HAL_TIM_STATE_BUSY;
185 
186  /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */
188 
189  /* Configure the Time base in the Encoder Mode */
190  TIM_Base_SetConfig(htim->Instance, &htim->Init);
191 
192  /* Configure the Channel 1 as Input Channel to interface with the three Outputs of the Hall sensor */
194 
195  /* Reset the IC1PSC Bits */
196  htim->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC;
197  /* Set the IC1PSC value */
198  htim->Instance->CCMR1 |= sConfig->IC1Prescaler;
199 
200  /* Enable the Hall sensor interface (XOR function of the three inputs) */
201  htim->Instance->CR2 |= TIM_CR2_TI1S;
202 
203  /* Select the TIM_TS_TI1F_ED signal as Input trigger for the TIM */
204  htim->Instance->SMCR &= ~TIM_SMCR_TS;
205  htim->Instance->SMCR |= TIM_TS_TI1F_ED;
206 
207  /* Use the TIM_TS_TI1F_ED signal to reset the TIM counter each edge detection */
208  htim->Instance->SMCR &= ~TIM_SMCR_SMS;
210 
211  /* Program channel 2 in PWM 2 mode with the desired Commutation_Delay*/
212  OC_Config.OCFastMode = TIM_OCFAST_DISABLE;
214  OC_Config.OCMode = TIM_OCMODE_PWM2;
216  OC_Config.OCNPolarity = TIM_OCNPOLARITY_HIGH;
217  OC_Config.OCPolarity = TIM_OCPOLARITY_HIGH;
218  OC_Config.Pulse = sConfig->Commutation_Delay;
219 
220  TIM_OC2_SetConfig(htim->Instance, &OC_Config);
221 
222  /* Select OC2REF as trigger output on TRGO: write the MMS bits in the TIMx_CR2
223  register to 101 */
224  htim->Instance->CR2 &= ~TIM_CR2_MMS;
225  htim->Instance->CR2 |= TIM_TRGO_OC2REF;
226 
227  /* Initialize the TIM state*/
228  htim->State= HAL_TIM_STATE_READY;
229 
230  return HAL_OK;
231 }
232 
240 {
241  /* Check the parameters */
243 
244  htim->State = HAL_TIM_STATE_BUSY;
245 
246  /* Disable the TIM Peripheral Clock */
247  __HAL_TIM_DISABLE(htim);
248 
249  /* DeInit the low level hardware: GPIO, CLOCK, NVIC */
251 
252  /* Change TIM state */
253  htim->State = HAL_TIM_STATE_RESET;
254 
255  /* Release Lock */
256  __HAL_UNLOCK(htim);
257 
258  return HAL_OK;
259 }
260 
268 {
269  /* Prevent unused argument(s) compilation warning */
270  UNUSED(htim);
271 
272  /* NOTE : This function Should not be modified, when the callback is needed,
273  the HAL_TIMEx_HallSensor_MspInit could be implemented in the user file
274  */
275 }
276 
284 {
285  /* Prevent unused argument(s) compilation warning */
286  UNUSED(htim);
287 
288  /* NOTE : This function Should not be modified, when the callback is needed,
289  the HAL_TIMEx_HallSensor_MspDeInit could be implemented in the user file
290  */
291 }
292 
300 {
301  /* Check the parameters */
303 
304  /* Enable the Input Capture channels 1
305  (in the Hall Sensor Interface the Three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
307 
308  /* Enable the Peripheral */
309  __HAL_TIM_ENABLE(htim);
310 
311  /* Return function status */
312  return HAL_OK;
313 }
314 
322 {
323  /* Check the parameters */
325 
326  /* Disable the Input Capture channels 1, 2 and 3
327  (in the Hall Sensor Interface the Three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
329 
330  /* Disable the Peripheral */
331  __HAL_TIM_DISABLE(htim);
332 
333  /* Return function status */
334  return HAL_OK;
335 }
336 
344 {
345  /* Check the parameters */
347 
348  /* Enable the capture compare Interrupts 1 event */
350 
351  /* Enable the Input Capture channels 1
352  (in the Hall Sensor Interface the Three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
354 
355  /* Enable the Peripheral */
356  __HAL_TIM_ENABLE(htim);
357 
358  /* Return function status */
359  return HAL_OK;
360 }
361 
369 {
370  /* Check the parameters */
372 
373  /* Disable the Input Capture channels 1
374  (in the Hall Sensor Interface the Three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
376 
377  /* Disable the capture compare Interrupts event */
379 
380  /* Disable the Peripheral */
381  __HAL_TIM_DISABLE(htim);
382 
383  /* Return function status */
384  return HAL_OK;
385 }
386 
395 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length)
396 {
397  /* Check the parameters */
399 
400  if((htim->State == HAL_TIM_STATE_BUSY))
401  {
402  return HAL_BUSY;
403  }
404  else if((htim->State == HAL_TIM_STATE_READY))
405  {
406  if(((uint32_t)pData == 0 ) && (Length > 0))
407  {
408  return HAL_ERROR;
409  }
410  else
411  {
412  htim->State = HAL_TIM_STATE_BUSY;
413  }
414  }
415  /* Enable the Input Capture channels 1
416  (in the Hall Sensor Interface the Three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
418 
419  /* Set the DMA Input Capture 1 Callback */
421  /* Set the DMA error callback */
423 
424  /* Enable the DMA Stream for Capture 1*/
425  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, Length);
426 
427  /* Enable the capture compare 1 Interrupt */
429 
430  /* Enable the Peripheral */
431  __HAL_TIM_ENABLE(htim);
432 
433  /* Return function status */
434  return HAL_OK;
435 }
436 
444 {
445  /* Check the parameters */
447 
448  /* Disable the Input Capture channels 1
449  (in the Hall Sensor Interface the Three possible channels that can be used are TIM_CHANNEL_1, TIM_CHANNEL_2 and TIM_CHANNEL_3) */
451 
452 
453  /* Disable the capture compare Interrupts 1 event */
455 
456  /* Disable the Peripheral */
457  __HAL_TIM_DISABLE(htim);
458 
459  /* Return function status */
460  return HAL_OK;
461 }
462 
501 {
502  /* Check the parameters */
503  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
504 
505  /* Enable the Capture compare channel N */
506  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
507 
508  /* Enable the Main Output */
509  __HAL_TIM_MOE_ENABLE(htim);
510 
511  /* Enable the Peripheral */
512  __HAL_TIM_ENABLE(htim);
513 
514  /* Return function status */
515  return HAL_OK;
516 }
517 
532 {
533  /* Check the parameters */
534  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
535 
536  /* Disable the Capture compare channel N */
537  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
538 
539  /* Disable the Main Output */
540  __HAL_TIM_MOE_DISABLE(htim);
541 
542  /* Disable the Peripheral */
543  __HAL_TIM_DISABLE(htim);
544 
545  /* Return function status */
546  return HAL_OK;
547 }
548 
563 {
564  /* Check the parameters */
565  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
566 
567  switch (Channel)
568  {
569  case TIM_CHANNEL_1:
570  {
571  /* Enable the TIM Output Compare interrupt */
573  }
574  break;
575 
576  case TIM_CHANNEL_2:
577  {
578  /* Enable the TIM Output Compare interrupt */
580  }
581  break;
582 
583  case TIM_CHANNEL_3:
584  {
585  /* Enable the TIM Output Compare interrupt */
587  }
588  break;
589 
590  case TIM_CHANNEL_4:
591  {
592  /* Enable the TIM Output Compare interrupt */
594  }
595  break;
596 
597  default:
598  break;
599  }
600 
601  /* Enable the TIM Break interrupt */
603 
604  /* Enable the Capture compare channel N */
605  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
606 
607  /* Enable the Main Output */
608  __HAL_TIM_MOE_ENABLE(htim);
609 
610  /* Enable the Peripheral */
611  __HAL_TIM_ENABLE(htim);
612 
613  /* Return function status */
614  return HAL_OK;
615 }
616 
631 {
632  uint32_t tmpccer = 0;
633 
634  /* Check the parameters */
635  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
636 
637  switch (Channel)
638  {
639  case TIM_CHANNEL_1:
640  {
641  /* Disable the TIM Output Compare interrupt */
643  }
644  break;
645 
646  case TIM_CHANNEL_2:
647  {
648  /* Disable the TIM Output Compare interrupt */
650  }
651  break;
652 
653  case TIM_CHANNEL_3:
654  {
655  /* Disable the TIM Output Compare interrupt */
657  }
658  break;
659 
660  case TIM_CHANNEL_4:
661  {
662  /* Disable the TIM Output Compare interrupt */
664  }
665  break;
666 
667  default:
668  break;
669  }
670 
671  /* Disable the Capture compare channel N */
672  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
673 
674  /* Disable the TIM Break interrupt (only if no more channel is active) */
675  tmpccer = htim->Instance->CCER;
676  if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == RESET)
677  {
679  }
680 
681  /* Disable the Main Output */
682  __HAL_TIM_MOE_DISABLE(htim);
683 
684  /* Disable the Peripheral */
685  __HAL_TIM_DISABLE(htim);
686 
687  /* Return function status */
688  return HAL_OK;
689 }
690 
706 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
707 {
708  /* Check the parameters */
709  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
710 
711  if((htim->State == HAL_TIM_STATE_BUSY))
712  {
713  return HAL_BUSY;
714  }
715  else if((htim->State == HAL_TIM_STATE_READY))
716  {
717  if(((uint32_t)pData == 0 ) && (Length > 0))
718  {
719  return HAL_ERROR;
720  }
721  else
722  {
723  htim->State = HAL_TIM_STATE_BUSY;
724  }
725  }
726  switch (Channel)
727  {
728  case TIM_CHANNEL_1:
729  {
730  /* Set the DMA Period elapsed callback */
732 
733  /* Set the DMA error callback */
735 
736  /* Enable the DMA Stream */
737  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length);
738 
739  /* Enable the TIM Output Compare DMA request */
741  }
742  break;
743 
744  case TIM_CHANNEL_2:
745  {
746  /* Set the DMA Period elapsed callback */
748 
749  /* Set the DMA error callback */
751 
752  /* Enable the DMA Stream */
753  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length);
754 
755  /* Enable the TIM Output Compare DMA request */
757  }
758  break;
759 
760  case TIM_CHANNEL_3:
761 {
762  /* Set the DMA Period elapsed callback */
764 
765  /* Set the DMA error callback */
767 
768  /* Enable the DMA Stream */
769  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3,Length);
770 
771  /* Enable the TIM Output Compare DMA request */
773  }
774  break;
775 
776  case TIM_CHANNEL_4:
777  {
778  /* Set the DMA Period elapsed callback */
780 
781  /* Set the DMA error callback */
783 
784  /* Enable the DMA Stream */
785  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, Length);
786 
787  /* Enable the TIM Output Compare DMA request */
789  }
790  break;
791 
792  default:
793  break;
794  }
795 
796  /* Enable the Capture compare channel N */
797  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
798 
799  /* Enable the Main Output */
800  __HAL_TIM_MOE_ENABLE(htim);
801 
802  /* Enable the Peripheral */
803  __HAL_TIM_ENABLE(htim);
804 
805  /* Return function status */
806  return HAL_OK;
807 }
808 
823 {
824  /* Check the parameters */
825  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
826 
827  switch (Channel)
828  {
829  case TIM_CHANNEL_1:
830  {
831  /* Disable the TIM Output Compare DMA request */
833  }
834  break;
835 
836  case TIM_CHANNEL_2:
837  {
838  /* Disable the TIM Output Compare DMA request */
840  }
841  break;
842 
843  case TIM_CHANNEL_3:
844  {
845  /* Disable the TIM Output Compare DMA request */
847  }
848  break;
849 
850  case TIM_CHANNEL_4:
851  {
852  /* Disable the TIM Output Compare interrupt */
854  }
855  break;
856 
857  default:
858  break;
859  }
860 
861  /* Disable the Capture compare channel N */
862  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
863 
864  /* Disable the Main Output */
865  __HAL_TIM_MOE_DISABLE(htim);
866 
867  /* Disable the Peripheral */
868  __HAL_TIM_DISABLE(htim);
869 
870  /* Change the htim state */
871  htim->State = HAL_TIM_STATE_READY;
872 
873  /* Return function status */
874  return HAL_OK;
875 }
876 
924 {
925  /* Check the parameters */
926  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
927 
928  /* Enable the complementary PWM output */
929  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
930 
931  /* Enable the Main Output */
932  __HAL_TIM_MOE_ENABLE(htim);
933 
934  /* Enable the Peripheral */
935  __HAL_TIM_ENABLE(htim);
936 
937  /* Return function status */
938  return HAL_OK;
939 }
940 
954 {
955  /* Check the parameters */
956  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
957 
958  /* Disable the complementary PWM output */
959  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
960 
961  /* Disable the Main Output */
962  __HAL_TIM_MOE_DISABLE(htim);
963 
964  /* Disable the Peripheral */
965  __HAL_TIM_DISABLE(htim);
966 
967  /* Return function status */
968  return HAL_OK;
969 }
970 
985 {
986  /* Check the parameters */
987  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
988 
989  switch (Channel)
990  {
991  case TIM_CHANNEL_1:
992  {
993  /* Enable the TIM Capture/Compare 1 interrupt */
995  }
996  break;
997 
998  case TIM_CHANNEL_2:
999  {
1000  /* Enable the TIM Capture/Compare 2 interrupt */
1002  }
1003  break;
1004 
1005  case TIM_CHANNEL_3:
1006  {
1007  /* Enable the TIM Capture/Compare 3 interrupt */
1009  }
1010  break;
1011 
1012  case TIM_CHANNEL_4:
1013  {
1014  /* Enable the TIM Capture/Compare 4 interrupt */
1016  }
1017  break;
1018 
1019  default:
1020  break;
1021  }
1022 
1023  /* Enable the TIM Break interrupt */
1025 
1026  /* Enable the complementary PWM output */
1027  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
1028 
1029  /* Enable the Main Output */
1030  __HAL_TIM_MOE_ENABLE(htim);
1031 
1032  /* Enable the Peripheral */
1033  __HAL_TIM_ENABLE(htim);
1034 
1035  /* Return function status */
1036  return HAL_OK;
1037 }
1038 
1053 {
1054  uint32_t tmpccer = 0;
1055 
1056  /* Check the parameters */
1057  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1058 
1059  switch (Channel)
1060  {
1061  case TIM_CHANNEL_1:
1062  {
1063  /* Disable the TIM Capture/Compare 1 interrupt */
1065  }
1066  break;
1067 
1068  case TIM_CHANNEL_2:
1069  {
1070  /* Disable the TIM Capture/Compare 2 interrupt */
1072  }
1073  break;
1074 
1075  case TIM_CHANNEL_3:
1076  {
1077  /* Disable the TIM Capture/Compare 3 interrupt */
1079  }
1080  break;
1081 
1082  case TIM_CHANNEL_4:
1083  {
1084  /* Disable the TIM Capture/Compare 3 interrupt */
1086  }
1087  break;
1088 
1089  default:
1090  break;
1091  }
1092 
1093  /* Disable the complementary PWM output */
1094  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
1095 
1096  /* Disable the TIM Break interrupt (only if no more channel is active) */
1097  tmpccer = htim->Instance->CCER;
1098  if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == RESET)
1099  {
1101  }
1102 
1103  /* Disable the Main Output */
1104  __HAL_TIM_MOE_DISABLE(htim);
1105 
1106  /* Disable the Peripheral */
1107  __HAL_TIM_DISABLE(htim);
1108 
1109  /* Return function status */
1110  return HAL_OK;
1111 }
1112 
1128 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
1129 {
1130  /* Check the parameters */
1131  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1132 
1133  if((htim->State == HAL_TIM_STATE_BUSY))
1134  {
1135  return HAL_BUSY;
1136  }
1137  else if((htim->State == HAL_TIM_STATE_READY))
1138  {
1139  if(((uint32_t)pData == 0 ) && (Length > 0))
1140  {
1141  return HAL_ERROR;
1142  }
1143  else
1144  {
1145  htim->State = HAL_TIM_STATE_BUSY;
1146  }
1147  }
1148  switch (Channel)
1149  {
1150  case TIM_CHANNEL_1:
1151  {
1152  /* Set the DMA Period elapsed callback */
1154 
1155  /* Set the DMA error callback */
1157 
1158  /* Enable the DMA Stream */
1159  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, Length);
1160 
1161  /* Enable the TIM Capture/Compare 1 DMA request */
1163  }
1164  break;
1165 
1166  case TIM_CHANNEL_2:
1167  {
1168  /* Set the DMA Period elapsed callback */
1170 
1171  /* Set the DMA error callback */
1173 
1174  /* Enable the DMA Stream */
1175  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, Length);
1176 
1177  /* Enable the TIM Capture/Compare 2 DMA request */
1179  }
1180  break;
1181 
1182  case TIM_CHANNEL_3:
1183  {
1184  /* Set the DMA Period elapsed callback */
1186 
1187  /* Set the DMA error callback */
1189 
1190  /* Enable the DMA Stream */
1191  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3,Length);
1192 
1193  /* Enable the TIM Capture/Compare 3 DMA request */
1195  }
1196  break;
1197 
1198  case TIM_CHANNEL_4:
1199  {
1200  /* Set the DMA Period elapsed callback */
1202 
1203  /* Set the DMA error callback */
1205 
1206  /* Enable the DMA Stream */
1207  HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, Length);
1208 
1209  /* Enable the TIM Capture/Compare 4 DMA request */
1211  }
1212  break;
1213 
1214  default:
1215  break;
1216  }
1217 
1218  /* Enable the complementary PWM output */
1219  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE);
1220 
1221  /* Enable the Main Output */
1222  __HAL_TIM_MOE_ENABLE(htim);
1223 
1224  /* Enable the Peripheral */
1225  __HAL_TIM_ENABLE(htim);
1226 
1227  /* Return function status */
1228  return HAL_OK;
1229 }
1230 
1245 {
1246  /* Check the parameters */
1247  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel));
1248 
1249  switch (Channel)
1250  {
1251  case TIM_CHANNEL_1:
1252  {
1253  /* Disable the TIM Capture/Compare 1 DMA request */
1255  }
1256  break;
1257 
1258  case TIM_CHANNEL_2:
1259  {
1260  /* Disable the TIM Capture/Compare 2 DMA request */
1262  }
1263  break;
1264 
1265  case TIM_CHANNEL_3:
1266  {
1267  /* Disable the TIM Capture/Compare 3 DMA request */
1269  }
1270  break;
1271 
1272  case TIM_CHANNEL_4:
1273  {
1274  /* Disable the TIM Capture/Compare 4 DMA request */
1276  }
1277  break;
1278 
1279  default:
1280  break;
1281  }
1282 
1283  /* Disable the complementary PWM output */
1284  TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE);
1285 
1286  /* Disable the Main Output */
1287  __HAL_TIM_MOE_DISABLE(htim);
1288 
1289  /* Disable the Peripheral */
1290  __HAL_TIM_DISABLE(htim);
1291 
1292  /* Change the htim state */
1293  htim->State = HAL_TIM_STATE_READY;
1294 
1295  /* Return function status */
1296  return HAL_OK;
1297 }
1298 
1332 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
1333  {
1334  /* Check the parameters */
1335  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1336 
1337  /* Enable the complementary One Pulse output */
1338  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE);
1339 
1340  /* Enable the Main Output */
1341  __HAL_TIM_MOE_ENABLE(htim);
1342 
1343  /* Return function status */
1344  return HAL_OK;
1345 }
1346 
1358 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
1359 {
1360 
1361  /* Check the parameters */
1362  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1363 
1364  /* Disable the complementary One Pulse output */
1365  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE);
1366 
1367  /* Disable the Main Output */
1368  __HAL_TIM_MOE_DISABLE(htim);
1369 
1370  /* Disable the Peripheral */
1371  __HAL_TIM_DISABLE(htim);
1372 
1373  /* Return function status */
1374  return HAL_OK;
1375 }
1376 
1389 {
1390  /* Check the parameters */
1391  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1392 
1393  /* Enable the TIM Capture/Compare 1 interrupt */
1395 
1396  /* Enable the TIM Capture/Compare 2 interrupt */
1398 
1399  /* Enable the complementary One Pulse output */
1400  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE);
1401 
1402  /* Enable the Main Output */
1403  __HAL_TIM_MOE_ENABLE(htim);
1404 
1405  /* Return function status */
1406  return HAL_OK;
1407  }
1408 
1421 {
1422  /* Check the parameters */
1423  assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel));
1424 
1425  /* Disable the TIM Capture/Compare 1 interrupt */
1427 
1428  /* Disable the TIM Capture/Compare 2 interrupt */
1430 
1431  /* Disable the complementary One Pulse output */
1432  TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE);
1433 
1434  /* Disable the Main Output */
1435  __HAL_TIM_MOE_DISABLE(htim);
1436 
1437  /* Disable the Peripheral */
1438  __HAL_TIM_DISABLE(htim);
1439 
1440  /* Return function status */
1441  return HAL_OK;
1442 }
1443 
1490 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
1491 {
1492  /* Check the parameters */
1495 
1496  __HAL_LOCK(htim);
1497 
1498  if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) ||
1499  (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3))
1500  {
1501  /* Select the Input trigger */
1502  htim->Instance->SMCR &= ~TIM_SMCR_TS;
1503  htim->Instance->SMCR |= InputTrigger;
1504  }
1505 
1506  /* Select the Capture Compare preload feature */
1507  htim->Instance->CR2 |= TIM_CR2_CCPC;
1508  /* Select the Commutation event source */
1509  htim->Instance->CR2 &= ~TIM_CR2_CCUS;
1510  htim->Instance->CR2 |= CommutationSource;
1511 
1512  __HAL_UNLOCK(htim);
1513 
1514  return HAL_OK;
1515 }
1516 
1540 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
1541 {
1542  /* Check the parameters */
1545 
1546  __HAL_LOCK(htim);
1547 
1548  if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) ||
1549  (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3))
1550  {
1551  /* Select the Input trigger */
1552  htim->Instance->SMCR &= ~TIM_SMCR_TS;
1553  htim->Instance->SMCR |= InputTrigger;
1554  }
1555 
1556  /* Select the Capture Compare preload feature */
1557  htim->Instance->CR2 |= TIM_CR2_CCPC;
1558  /* Select the Commutation event source */
1559  htim->Instance->CR2 &= ~TIM_CR2_CCUS;
1560  htim->Instance->CR2 |= CommutationSource;
1561 
1562  /* Enable the Commutation Interrupt Request */
1564 
1565  __HAL_UNLOCK(htim);
1566 
1567  return HAL_OK;
1568 }
1569 
1594 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
1595 {
1596  /* Check the parameters */
1599 
1600  __HAL_LOCK(htim);
1601 
1602  if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) ||
1603  (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3))
1604  {
1605  /* Select the Input trigger */
1606  htim->Instance->SMCR &= ~TIM_SMCR_TS;
1607  htim->Instance->SMCR |= InputTrigger;
1608  }
1609 
1610  /* Select the Capture Compare preload feature */
1611  htim->Instance->CR2 |= TIM_CR2_CCPC;
1612  /* Select the Commutation event source */
1613  htim->Instance->CR2 &= ~TIM_CR2_CCUS;
1614  htim->Instance->CR2 |= CommutationSource;
1615 
1616  /* Enable the Commutation DMA Request */
1617  /* Set the DMA Commutation Callback */
1619  /* Set the DMA error callback */
1621 
1622  /* Enable the Commutation DMA Request */
1624 
1625  __HAL_UNLOCK(htim);
1626 
1627  return HAL_OK;
1628 }
1629 
1646 {
1647  /* Check the parameters */
1648  assert_param(IS_TIM_CHANNELS(Channel));
1649  assert_param(IS_TIM_OC_MODE(sConfig->OCMode));
1651 
1652  /* Check input state */
1653  __HAL_LOCK(htim);
1654 
1655  htim->State = HAL_TIM_STATE_BUSY;
1656 
1657  switch (Channel)
1658  {
1659  case TIM_CHANNEL_1:
1660  {
1661  /* Check the parameters */
1663 
1664  /* Configure the TIM Channel 1 in Output Compare */
1665  TIM_OC1_SetConfig(htim->Instance, sConfig);
1666  }
1667  break;
1668 
1669  case TIM_CHANNEL_2:
1670  {
1671  /* Check the parameters */
1673 
1674  /* Configure the TIM Channel 2 in Output Compare */
1675  TIM_OC2_SetConfig(htim->Instance, sConfig);
1676  }
1677  break;
1678 
1679  case TIM_CHANNEL_3:
1680  {
1681  /* Check the parameters */
1683 
1684  /* Configure the TIM Channel 3 in Output Compare */
1685  TIM_OC3_SetConfig(htim->Instance, sConfig);
1686  }
1687  break;
1688 
1689  case TIM_CHANNEL_4:
1690  {
1691  /* Check the parameters */
1693 
1694  /* Configure the TIM Channel 4 in Output Compare */
1695  TIM_OC4_SetConfig(htim->Instance, sConfig);
1696  }
1697  break;
1698 
1699  case TIM_CHANNEL_5:
1700  {
1701  /* Check the parameters */
1703 
1704  /* Configure the TIM Channel 5 in Output Compare */
1705  TIM_OC5_SetConfig(htim->Instance, sConfig);
1706  }
1707  break;
1708 
1709  case TIM_CHANNEL_6:
1710  {
1711  /* Check the parameters */
1713 
1714  /* Configure the TIM Channel 6 in Output Compare */
1715  TIM_OC6_SetConfig(htim->Instance, sConfig);
1716  }
1717  break;
1718 
1719  default:
1720  break;
1721  }
1722 
1723  htim->State = HAL_TIM_STATE_READY;
1724 
1725  __HAL_UNLOCK(htim);
1726 
1727  return HAL_OK;
1728 }
1729 
1746  TIM_OC_InitTypeDef* sConfig,
1747  uint32_t Channel)
1748 {
1749  /* Check the parameters */
1750  assert_param(IS_TIM_CHANNELS(Channel));
1751  assert_param(IS_TIM_PWM_MODE(sConfig->OCMode));
1754 
1755  /* Check input state */
1756  __HAL_LOCK(htim);
1757 
1758  htim->State = HAL_TIM_STATE_BUSY;
1759 
1760  switch (Channel)
1761  {
1762  case TIM_CHANNEL_1:
1763  {
1764  /* Check the parameters */
1766 
1767  /* Configure the Channel 1 in PWM mode */
1768  TIM_OC1_SetConfig(htim->Instance, sConfig);
1769 
1770  /* Set the Preload enable bit for channel1 */
1771  htim->Instance->CCMR1 |= TIM_CCMR1_OC1PE;
1772 
1773  /* Configure the Output Fast mode */
1774  htim->Instance->CCMR1 &= ~TIM_CCMR1_OC1FE;
1775  htim->Instance->CCMR1 |= sConfig->OCFastMode;
1776  }
1777  break;
1778 
1779  case TIM_CHANNEL_2:
1780  {
1781  /* Check the parameters */
1783 
1784  /* Configure the Channel 2 in PWM mode */
1785  TIM_OC2_SetConfig(htim->Instance, sConfig);
1786 
1787  /* Set the Preload enable bit for channel2 */
1788  htim->Instance->CCMR1 |= TIM_CCMR1_OC2PE;
1789 
1790  /* Configure the Output Fast mode */
1791  htim->Instance->CCMR1 &= ~TIM_CCMR1_OC2FE;
1792  htim->Instance->CCMR1 |= sConfig->OCFastMode << 8;
1793  }
1794  break;
1795 
1796  case TIM_CHANNEL_3:
1797  {
1798  /* Check the parameters */
1800 
1801  /* Configure the Channel 3 in PWM mode */
1802  TIM_OC3_SetConfig(htim->Instance, sConfig);
1803 
1804  /* Set the Preload enable bit for channel3 */
1805  htim->Instance->CCMR2 |= TIM_CCMR2_OC3PE;
1806 
1807  /* Configure the Output Fast mode */
1808  htim->Instance->CCMR2 &= ~TIM_CCMR2_OC3FE;
1809  htim->Instance->CCMR2 |= sConfig->OCFastMode;
1810  }
1811  break;
1812 
1813  case TIM_CHANNEL_4:
1814  {
1815  /* Check the parameters */
1817 
1818  /* Configure the Channel 4 in PWM mode */
1819  TIM_OC4_SetConfig(htim->Instance, sConfig);
1820 
1821  /* Set the Preload enable bit for channel4 */
1822  htim->Instance->CCMR2 |= TIM_CCMR2_OC4PE;
1823 
1824  /* Configure the Output Fast mode */
1825  htim->Instance->CCMR2 &= ~TIM_CCMR2_OC4FE;
1826  htim->Instance->CCMR2 |= sConfig->OCFastMode << 8;
1827  }
1828  break;
1829 
1830  case TIM_CHANNEL_5:
1831  {
1832  /* Check the parameters */
1834 
1835  /* Configure the Channel 5 in PWM mode */
1836  TIM_OC5_SetConfig(htim->Instance, sConfig);
1837 
1838  /* Set the Preload enable bit for channel5*/
1839  htim->Instance->CCMR3 |= TIM_CCMR3_OC5PE;
1840 
1841  /* Configure the Output Fast mode */
1842  htim->Instance->CCMR3 &= ~TIM_CCMR3_OC5FE;
1843  htim->Instance->CCMR3 |= sConfig->OCFastMode;
1844  }
1845  break;
1846 
1847  case TIM_CHANNEL_6:
1848  {
1849  /* Check the parameters */
1851 
1852  /* Configure the Channel 5 in PWM mode */
1853  TIM_OC6_SetConfig(htim->Instance, sConfig);
1854 
1855  /* Set the Preload enable bit for channel6 */
1856  htim->Instance->CCMR3 |= TIM_CCMR3_OC6PE;
1857 
1858  /* Configure the Output Fast mode */
1859  htim->Instance->CCMR3 &= ~TIM_CCMR3_OC6FE;
1860  htim->Instance->CCMR3 |= sConfig->OCFastMode << 8;
1861  }
1862  break;
1863 
1864  default:
1865  break;
1866  }
1867 
1868  htim->State = HAL_TIM_STATE_READY;
1869 
1870  __HAL_UNLOCK(htim);
1871 
1872  return HAL_OK;
1873 }
1874 
1891  TIM_ClearInputConfigTypeDef *sClearInputConfig,
1892  uint32_t Channel)
1893 {
1894  uint32_t tmpsmcr = 0;
1895 
1896  /* Check the parameters */
1899 
1900  /* Check input state */
1901  __HAL_LOCK(htim);
1902 
1903  switch (sClearInputConfig->ClearInputSource)
1904  {
1906  {
1907  /* Get the TIMx SMCR register value */
1908  tmpsmcr = htim->Instance->SMCR;
1909 
1910  /* Clear the OCREF clear selection bit */
1911  tmpsmcr &= ~TIM_SMCR_OCCS;
1912 
1913  /* Clear the ETR Bits */
1915 
1916  /* Set TIMx_SMCR */
1917  htim->Instance->SMCR = tmpsmcr;
1918  }
1919  break;
1920 
1922  {
1923  /* Clear the OCREF clear selection bit */
1924  htim->Instance->SMCR &= ~TIM_SMCR_OCCS;
1925  }
1926  break;
1927 
1929  {
1930  /* Check the parameters */
1934 
1936  sClearInputConfig->ClearInputPrescaler,
1937  sClearInputConfig->ClearInputPolarity,
1938  sClearInputConfig->ClearInputFilter);
1939 
1940  /* Set the OCREF clear selection bit */
1941  htim->Instance->SMCR |= TIM_SMCR_OCCS;
1942  }
1943  break;
1944  default:
1945  break;
1946  }
1947 
1948  switch (Channel)
1949  {
1950  case TIM_CHANNEL_1:
1951  {
1952  if(sClearInputConfig->ClearInputState != RESET)
1953  {
1954  /* Enable the Ocref clear feature for Channel 1 */
1955  htim->Instance->CCMR1 |= TIM_CCMR1_OC1CE;
1956  }
1957  else
1958  {
1959  /* Disable the Ocref clear feature for Channel 1 */
1960  htim->Instance->CCMR1 &= ~TIM_CCMR1_OC1CE;
1961  }
1962  }
1963  break;
1964  case TIM_CHANNEL_2:
1965  {
1966  if(sClearInputConfig->ClearInputState != RESET)
1967  {
1968  /* Enable the Ocref clear feature for Channel 2 */
1969  htim->Instance->CCMR1 |= TIM_CCMR1_OC2CE;
1970  }
1971  else
1972  {
1973  /* Disable the Ocref clear feature for Channel 2 */
1974  htim->Instance->CCMR1 &= ~TIM_CCMR1_OC2CE;
1975  }
1976  }
1977  break;
1978  case TIM_CHANNEL_3:
1979  {
1980  if(sClearInputConfig->ClearInputState != RESET)
1981  {
1982  /* Enable the Ocref clear feature for Channel 3 */
1983  htim->Instance->CCMR2 |= TIM_CCMR2_OC3CE;
1984  }
1985  else
1986  {
1987  /* Disable the Ocref clear feature for Channel 3 */
1988  htim->Instance->CCMR2 &= ~TIM_CCMR2_OC3CE;
1989  }
1990  }
1991  break;
1992  case TIM_CHANNEL_4:
1993  {
1994  if(sClearInputConfig->ClearInputState != RESET)
1995  {
1996  /* Enable the Ocref clear feature for Channel 4 */
1997  htim->Instance->CCMR2 |= TIM_CCMR2_OC4CE;
1998  }
1999  else
2000  {
2001  /* Disable the Ocref clear feature for Channel 4 */
2002  htim->Instance->CCMR2 &= ~TIM_CCMR2_OC4CE;
2003  }
2004  }
2005  break;
2006  case TIM_CHANNEL_5:
2007  {
2008  if(sClearInputConfig->ClearInputState != RESET)
2009  {
2010  /* Enable the Ocref clear feature for Channel 1 */
2011  htim->Instance->CCMR3 |= TIM_CCMR3_OC5CE;
2012  }
2013  else
2014  {
2015  /* Disable the Ocref clear feature for Channel 1 */
2016  htim->Instance->CCMR3 &= ~TIM_CCMR3_OC5CE;
2017  }
2018  }
2019  break;
2020  case TIM_CHANNEL_6:
2021  {
2022  if(sClearInputConfig->ClearInputState != RESET)
2023  {
2024  /* Enable the Ocref clear feature for Channel 1 */
2025  htim->Instance->CCMR3 |= TIM_CCMR3_OC6CE;
2026  }
2027  else
2028  {
2029  /* Disable the Ocref clear feature for Channel 1 */
2030  htim->Instance->CCMR3 &= ~TIM_CCMR3_OC6CE;
2031  }
2032  }
2033  break;
2034  default:
2035  break;
2036  }
2037 
2038  __HAL_UNLOCK(htim);
2039 
2040  return HAL_OK;
2041 }
2042 
2053 {
2054  uint32_t tmpcr2;
2055  uint32_t tmpsmcr;
2056 
2057  /* Check the parameters */
2061 
2062  /* Check input state */
2063  __HAL_LOCK(htim);
2064 
2065  /* Get the TIMx CR2 register value */
2066  tmpcr2 = htim->Instance->CR2;
2067 
2068  /* Get the TIMx SMCR register value */
2069  tmpsmcr = htim->Instance->SMCR;
2070 
2071  /* If the timer supports ADC synchronization through TRGO2, set the master mode selection 2 */
2072  if (IS_TIM_TRGO2_INSTANCE(htim->Instance))
2073  {
2074  /* Check the parameters */
2076 
2077  /* Clear the MMS2 bits */
2078  tmpcr2 &= ~TIM_CR2_MMS2;
2079  /* Select the TRGO2 source*/
2080  tmpcr2 |= sMasterConfig->MasterOutputTrigger2;
2081  }
2082 
2083  /* Reset the MMS Bits */
2084  tmpcr2 &= ~TIM_CR2_MMS;
2085  /* Select the TRGO source */
2086  tmpcr2 |= sMasterConfig->MasterOutputTrigger;
2087 
2088  /* Reset the MSM Bit */
2089  tmpsmcr &= ~TIM_SMCR_MSM;
2090  /* Set master mode */
2091  tmpsmcr |= sMasterConfig->MasterSlaveMode;
2092 
2093  /* Update TIMx CR2 */
2094  htim->Instance->CR2 = tmpcr2;
2095 
2096  /* Update TIMx SMCR */
2097  htim->Instance->SMCR = tmpsmcr;
2098 
2099  __HAL_UNLOCK(htim);
2100 
2101  return HAL_OK;
2102 }
2103 
2114  TIM_BreakDeadTimeConfigTypeDef * sBreakDeadTimeConfig)
2115 {
2116  uint32_t tmpbdtr = 0;
2117 
2118  /* Check the parameters */
2120  assert_param(IS_TIM_OSSR_STATE(sBreakDeadTimeConfig->OffStateRunMode));
2121  assert_param(IS_TIM_OSSI_STATE(sBreakDeadTimeConfig->OffStateIDLEMode));
2122  assert_param(IS_TIM_LOCK_LEVEL(sBreakDeadTimeConfig->LockLevel));
2123  assert_param(IS_TIM_DEADTIME(sBreakDeadTimeConfig->DeadTime));
2124  assert_param(IS_TIM_BREAK_STATE(sBreakDeadTimeConfig->BreakState));
2125  assert_param(IS_TIM_BREAK_POLARITY(sBreakDeadTimeConfig->BreakPolarity));
2126  assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->BreakFilter));
2128  assert_param(IS_TIM_BREAK2_STATE(sBreakDeadTimeConfig->Break2State));
2129  assert_param(IS_TIM_BREAK2_POLARITY(sBreakDeadTimeConfig->Break2Polarity));
2130  assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->Break2Filter));
2131 
2132  /* Check input state */
2133  __HAL_LOCK(htim);
2134 
2135  htim->State = HAL_TIM_STATE_BUSY;
2136 
2137  /* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State,
2138  the OSSI State, the dead time value and the Automatic Output Enable Bit */
2139 
2140  /* Clear the BDTR bits */
2141  tmpbdtr &= ~(TIM_BDTR_DTG | TIM_BDTR_LOCK | TIM_BDTR_OSSI |
2145 
2146  /* Set the BDTR bits */
2147  tmpbdtr |= sBreakDeadTimeConfig->DeadTime;
2148  tmpbdtr |= sBreakDeadTimeConfig->LockLevel;
2149  tmpbdtr |= sBreakDeadTimeConfig->OffStateIDLEMode;
2150  tmpbdtr |= sBreakDeadTimeConfig->OffStateRunMode;
2151  tmpbdtr |= sBreakDeadTimeConfig->BreakState;
2152  tmpbdtr |= sBreakDeadTimeConfig->BreakPolarity;
2153  tmpbdtr |= sBreakDeadTimeConfig->AutomaticOutput;
2154  tmpbdtr |= (sBreakDeadTimeConfig->BreakFilter << BDTR_BKF_SHIFT);
2155  tmpbdtr |= (sBreakDeadTimeConfig->Break2Filter << BDTR_BK2F_SHIFT);
2156  tmpbdtr |= sBreakDeadTimeConfig->Break2State;
2157  tmpbdtr |= sBreakDeadTimeConfig->Break2Polarity;
2158 
2159  /* Set TIMx_BDTR */
2160  htim->Instance->BDTR = tmpbdtr;
2161 
2162  __HAL_UNLOCK(htim);
2163 
2164  return HAL_OK;
2165 }
2166 #if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
2167 
2177 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim,
2178  uint32_t BreakInput,
2179  TIMEx_BreakInputConfigTypeDef *sBreakInputConfig)
2180 
2181 {
2182  uint32_t tmporx = 0;
2183  uint32_t bkin_enable_mask = 0;
2184  uint32_t bkin_enable_bitpos = 0;
2185 
2186  /* Check the parameters */
2188  assert_param(IS_TIM_BREAKINPUT(BreakInput));
2189  assert_param(IS_TIM_BREAKINPUTSOURCE(sBreakInputConfig->Source));
2190  assert_param(IS_TIM_BREAKINPUTSOURCE_STATE(sBreakInputConfig->Enable));
2191 
2192  /* Check input state */
2193  __HAL_LOCK(htim);
2194 
2195  switch(sBreakInputConfig->Source)
2196  {
2197  case TIM_BREAKINPUTSOURCE_BKIN:
2198  {
2199  bkin_enable_mask = TIM1_AF1_BKINE;
2200  bkin_enable_bitpos = 0;
2201  }
2202  break;
2203 
2204  case TIM_BREAKINPUTSOURCE_DFSDM1:
2205  {
2206  bkin_enable_mask = TIM1_AF1_BKDF1BKE;
2207  bkin_enable_bitpos = 8;
2208  }
2209  break;
2210 
2211  default:
2212  break;
2213  }
2214 
2215  switch(BreakInput)
2216  {
2217  case TIM_BREAKINPUT_BRK:
2218  {
2219  /* Get the TIMx_AF1 register value */
2220  tmporx = htim->Instance->AF1;
2221 
2222  /* Enable the break input */
2223  tmporx &= ~bkin_enable_mask;
2224  tmporx |= (sBreakInputConfig->Enable << bkin_enable_bitpos) & bkin_enable_mask;
2225 
2226  /* Set TIMx_AF1 */
2227  htim->Instance->AF1 = tmporx;
2228  }
2229  break;
2230  case TIM_BREAKINPUT_BRK2:
2231  {
2232  /* Get the TIMx_AF2 register value */
2233  tmporx = htim->Instance->AF2;
2234 
2235  /* Enable the break input */
2236  tmporx &= ~bkin_enable_mask;
2237  tmporx |= (sBreakInputConfig->Enable << bkin_enable_bitpos) & bkin_enable_mask;
2238 
2239  /* Set TIMx_AF2 */
2240  htim->Instance->AF2 = tmporx;
2241  }
2242  break;
2243  default:
2244  break;
2245  }
2246 
2247  __HAL_UNLOCK(htim);
2248 
2249  return HAL_OK;
2250 }
2251 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
2252 
2275 {
2276  __HAL_LOCK(htim);
2277 
2278  /* Check parameters */
2280  assert_param(IS_TIM_REMAP(Remap));
2281 
2282  /* Set the Timer remapping configuration */
2283  htim->Instance->OR = Remap;
2284 
2285  htim->State = HAL_TIM_STATE_READY;
2286 
2287  __HAL_UNLOCK(htim);
2288 
2289  return HAL_OK;
2290 }
2291 
2304 {
2305  /* Check parameters */
2307  assert_param(IS_TIM_GROUPCH5(OCRef));
2308 
2309  /* Process Locked */
2310  __HAL_LOCK(htim);
2311 
2312  htim->State = HAL_TIM_STATE_BUSY;
2313 
2314  /* Clear GC5Cx bit fields */
2316 
2317  /* Set GC5Cx bit fields */
2318  htim->Instance->CCR5 |= OCRef;
2319 
2320  htim->State = HAL_TIM_STATE_READY;
2321 
2322  __HAL_UNLOCK(htim);
2323 
2324  return HAL_OK;
2325 }
2326 
2354 {
2355  /* Prevent unused argument(s) compilation warning */
2356  UNUSED(htim);
2357 
2358  /* NOTE : This function Should not be modified, when the callback is needed,
2359  the HAL_TIMEx_CommutationCallback could be implemented in the user file
2360  */
2361 }
2362 
2369 __weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim)
2370 {
2371  /* Prevent unused argument(s) compilation warning */
2372  UNUSED(htim);
2373 
2374  /* NOTE : This function Should not be modified, when the callback is needed,
2375  the HAL_TIMEx_BreakCallback could be implemented in the user file
2376  */
2377 }
2378 
2405 {
2406  return htim->State;
2407 }
2408 
2420 {
2421  TIM_HandleTypeDef* htim = ( TIM_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;
2422 
2423  htim->State= HAL_TIM_STATE_READY;
2424 
2426 }
2427 
2440 static void TIM_CCxNChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelNState)
2441 {
2442  uint32_t tmp = 0;
2443 
2444  /* Check the parameters */
2447 
2448  tmp = TIM_CCER_CC1NE << Channel;
2449 
2450  /* Reset the CCxNE Bit */
2451  TIMx->CCER &= ~tmp;
2452 
2453  /* Set or reset the CCxNE Bit */
2454  TIMx->CCER |= (uint32_t)(ChannelNState << Channel);
2455 }
2456 
2463 static void TIM_OC5_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
2464 {
2465  uint32_t tmpccmrx = 0;
2466  uint32_t tmpccer = 0;
2467  uint32_t tmpcr2 = 0;
2468 
2469  /* Disable the output: Reset the CCxE Bit */
2470  TIMx->CCER &= ~TIM_CCER_CC5E;
2471 
2472  /* Get the TIMx CCER register value */
2473  tmpccer = TIMx->CCER;
2474  /* Get the TIMx CR2 register value */
2475  tmpcr2 = TIMx->CR2;
2476  /* Get the TIMx CCMR1 register value */
2477  tmpccmrx = TIMx->CCMR3;
2478 
2479  /* Reset the Output Compare Mode Bits */
2480  tmpccmrx &= ~(TIM_CCMR3_OC5M);
2481  /* Select the Output Compare Mode */
2482  tmpccmrx |= OC_Config->OCMode;
2483 
2484  /* Reset the Output Polarity level */
2485  tmpccer &= ~TIM_CCER_CC5P;
2486  /* Set the Output Compare Polarity */
2487  tmpccer |= (OC_Config->OCPolarity << 16);
2488 
2489  if(IS_TIM_BREAK_INSTANCE(TIMx))
2490  {
2491  /* Reset the Output Compare IDLE State */
2492  tmpcr2 &= ~TIM_CR2_OIS5;
2493  /* Set the Output Idle state */
2494  tmpcr2 |= (OC_Config->OCIdleState << 8);
2495  }
2496  /* Write to TIMx CR2 */
2497  TIMx->CR2 = tmpcr2;
2498 
2499  /* Write to TIMx CCMR3 */
2500  TIMx->CCMR3 = tmpccmrx;
2501 
2502  /* Set the Capture Compare Register value */
2503  TIMx->CCR5 = OC_Config->Pulse;
2504 
2505  /* Write to TIMx CCER */
2506  TIMx->CCER = tmpccer;
2507 }
2508 
2515 static void TIM_OC6_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
2516 {
2517  uint32_t tmpccmrx = 0;
2518  uint32_t tmpccer = 0;
2519  uint32_t tmpcr2 = 0;
2520 
2521  /* Disable the output: Reset the CCxE Bit */
2522  TIMx->CCER &= ~TIM_CCER_CC6E;
2523 
2524  /* Get the TIMx CCER register value */
2525  tmpccer = TIMx->CCER;
2526  /* Get the TIMx CR2 register value */
2527  tmpcr2 = TIMx->CR2;
2528  /* Get the TIMx CCMR1 register value */
2529  tmpccmrx = TIMx->CCMR3;
2530 
2531  /* Reset the Output Compare Mode Bits */
2532  tmpccmrx &= ~(TIM_CCMR3_OC6M);
2533  /* Select the Output Compare Mode */
2534  tmpccmrx |= (OC_Config->OCMode << 8);
2535 
2536  /* Reset the Output Polarity level */
2537  tmpccer &= (uint32_t)~TIM_CCER_CC6P;
2538  /* Set the Output Compare Polarity */
2539  tmpccer |= (OC_Config->OCPolarity << 20);
2540 
2541  if(IS_TIM_BREAK_INSTANCE(TIMx))
2542  {
2543  /* Reset the Output Compare IDLE State */
2544  tmpcr2 &= ~TIM_CR2_OIS6;
2545  /* Set the Output Idle state */
2546  tmpcr2 |= (OC_Config->OCIdleState << 10);
2547  }
2548 
2549  /* Write to TIMx CR2 */
2550  TIMx->CR2 = tmpcr2;
2551 
2552  /* Write to TIMx CCMR3 */
2553  TIMx->CCMR3 = tmpccmrx;
2554 
2555  /* Set the Capture Compare Register value */
2556  TIMx->CCR6 = OC_Config->Pulse;
2557 
2558  /* Write to TIMx CCER */
2559  TIMx->CCER = tmpccer;
2560 }
2561 
2566 #endif /* HAL_TIM_MODULE_ENABLED */
2567 
2574 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim)
#define TIM_DMA_CC4
HAL_TIM_StateTypeDef
HAL State structures definition.
#define TIM_SLAVEMODE_RESET
#define TIM_CHANNEL_4
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
#define __HAL_TIM_DISABLE_DMA(__HANDLE__, __DMA__)
HAL_StatusTypeDef HAL_TIM_ConfigOCrefClear(TIM_HandleTypeDef *htim, TIM_ClearInputConfigTypeDef *sClearInputConfig, uint32_t Channel)
TIM Hall sensor Configuration Structure definition.
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
#define TIM_TS_ITR0
#define TIM_DMA_CC3
TIM Master configuration Structure definition.
DMA_HandleTypeDef * hdma[7]
#define TIM_DMA_ID_CC3
#define TIM_BDTR_BKE
Definition: stm32f745xx.h:7252
#define TIM_IT_CC1
#define TIM_CCER_CC1NE
Definition: stm32f745xx.h:7192
#define TIM_BDTR_BK2E
Definition: stm32f745xx.h:7258
#define TIM_CHANNEL_1
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim)
#define assert_param(expr)
Include module&#39;s header file.
TIM Output Compare Configuration Structure definition.
#define IS_TIM_ADVANCED_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8995
#define IS_TIM_TRGO_SOURCE(__SOURCE__)
#define IS_TIM_CC3_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8938
HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim)
void HAL_TIM_DMAError(DMA_HandleTypeDef *hdma)
#define TIM_CCER_CC2NE
Definition: stm32f745xx.h:7196
#define TIM_BDTR_LOCK
Definition: stm32f745xx.h:7246
#define TIM_CCx_DISABLE
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
#define TIM_IT_CC3
HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
#define TIM_CCMR3_OC6PE
Definition: stm32f745xx.h:7300
#define IS_TIM_CC6_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8989
#define TIM_CCER_CC6P
Definition: stm32f745xx.h:7208
#define TIM_BDTR_DTG
Definition: stm32f745xx.h:7236
#define TIM_CCMR3_OC5PE
Definition: stm32f745xx.h:7289
#define IS_TIM_OSSI_STATE(__STATE__)
__IO uint32_t CCR1
Definition: stm32f745xx.h:894
#define TIM_CR2_MMS2
Definition: stm32f745xx.h:6995
__IO uint32_t AF1
Definition: stm32f765xx.h:950
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
#define __HAL_UNLOCK(__HANDLE__)
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim)
#define IS_TIM_COUNTER_MODE(__MODE__)
#define IS_TIM_OSSR_STATE(__STATE__)
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef *sMasterConfig)
#define TIM_CCMR3_OC5FE
Definition: stm32f745xx.h:7288
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
#define TIM_CCMR1_OC2FE
Definition: stm32f745xx.h:7101
#define TIM_DMA_ID_CC2
void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
#define TIM_DMA_COM
#define __HAL_TIM_DISABLE(__HANDLE__)
Disable the TIM peripheral.
#define TIM_SMCR_OCCS
Definition: stm32f745xx.h:7016
void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim)
__IO uint32_t CCR4
Definition: stm32f745xx.h:897
#define TIM_DMA_ID_CC4
#define IS_TIM_CC5_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8984
#define TIM_CCR5_GC5C2
Definition: stm32f745xx.h:7313
HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t OCRef)
TIM Break input(s) and Dead time configuration Structure definition.
#define TIM_CCMR2_OC4CE
Definition: stm32f745xx.h:7165
HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
#define TIM_BDTR_BKP
Definition: stm32f745xx.h:7253
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
#define TIM_CCMR1_OC1FE
Definition: stm32f745xx.h:7086
void HAL_TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma)
#define IS_TIM_CLEARINPUT_FILTER(__ICFILTER__)
#define IS_TIM_XOR_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:9004
HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
#define TIM_CHANNEL_3
#define IS_TIM_CCXN_INSTANCE(__INSTANCE__, __CHANNEL__)
Definition: stm32f745xx.h:9143
#define TIM1_AF1_BKINE
Definition: stm32f765xx.h:7661
#define TIM_CCMR2_OC3CE
Definition: stm32f745xx.h:7150
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
__IO uint32_t SMCR
Definition: stm32f745xx.h:883
#define TIM_CR2_OIS6
Definition: stm32f745xx.h:6988
#define IS_TIM_GROUPCH5(OCREF)
#define TIM_CHANNEL_5
#define TIM_CCR5_GC5C3
Definition: stm32f745xx.h:7314
#define TIM_SMCR_ETPS
Definition: stm32f745xx.h:7031
#define IS_TIM_CLEARINPUT_SOURCE(MODE)
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim)
void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim)
#define TIM_CCMR1_OC2PE
Definition: stm32f745xx.h:7102
#define TIM_CCER_CC6E
Definition: stm32f745xx.h:7207
#define TIM_CCER_CC5P
Definition: stm32f745xx.h:7206
void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef *htim)
__IO HAL_TIM_StateTypeDef State
#define __HAL_TIM_ENABLE_DMA(__HANDLE__, __DMA__)
#define IS_TIM_IC_POLARITY(__POLARITY__)
#define TIM_CLEARINPUTSOURCE_NONE
#define TIM_DMA_ID_CC1
void TIM_ETR_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ExtTRGPrescaler, uint32_t TIM_ExtTRGPolarity, uint32_t ExtTRGFilter)
#define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(__SELECTION__)
void TIM_OC4_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
#define __HAL_LOCK(__HANDLE__)
__IO uint32_t BDTR
Definition: stm32f745xx.h:898
__IO uint32_t AF2
Definition: stm32f765xx.h:951
#define TIM_OCNIDLESTATE_RESET
#define TIM_SMCR_TS
Definition: stm32f745xx.h:7018
void HAL_TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma)
#define IS_TIM_FAST_STATE(__STATE__)
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef *sConfig)
#define NULL
Definition: usbd_def.h:53
__IO uint32_t CCR5
Definition: stm32f745xx.h:903
#define TIM_SMCR_ECE
Definition: stm32f745xx.h:7035
#define TIM_CCER_CC5E
Definition: stm32f745xx.h:7205
#define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL)
#define TIM_DMA_CC1
#define TIM_CR2_CCPC
Definition: stm32f745xx.h:6983
#define __HAL_TIM_MOE_DISABLE(__HANDLE__)
Disable the TIM main Output.
#define TIM_CCMR1_OC2CE
Definition: stm32f745xx.h:7110
#define TIM_OCFAST_DISABLE
#define TIM_ICSELECTION_TRC
#define TIM_CHANNEL_2
#define TIM_CLEARINPUTSOURCE_OCREFCLR
#define TIM_TS_ITR3
#define TIM_CCMR2_OC3PE
Definition: stm32f745xx.h:7140
Clear Input Configuration Handle Structure definition.
__IO uint32_t CCMR3
Definition: stm32f745xx.h:902
#define IS_TIM_BREAK_STATE(__STATE__)
__IO uint32_t CR2
Definition: stm32f745xx.h:882
#define TIM_CCx_ENABLE
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
__IO uint32_t CCMR1
Definition: stm32f745xx.h:887
#define __HAL_TIM_MOE_ENABLE(__HANDLE__)
Enable the TIM main Output.
This file contains all the functions prototypes for the HAL module driver.
#define IS_TIM_OC_POLARITY(__POLARITY__)
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
#define TIM_BDTR_AOE
Definition: stm32f745xx.h:7254
__IO uint32_t CCER
Definition: stm32f745xx.h:889
#define IS_TIM_MSM_STATE(__STATE__)
#define TIM_IT_BREAK
#define IS_TIM_COMBINED3PHASEPWM_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8954
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
#define IS_TIM_BREAK_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8999
#define IS_TIM_BREAK2_STATE(STATE)
#define IS_TIM_OCXREF_CLEAR_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8959
#define IS_TIM_DEADTIME(__DEADTIME__)
#define IS_TIM_OC_MODE(MODE)
#define TIM_DMA_CC2
#define TIM_BDTR_BKF
Definition: stm32f745xx.h:7256
#define TIM_CLEARINPUTSOURCE_ETR
#define TIM_IT_CC4
#define TIM_CCMR3_OC6CE
Definition: stm32f745xx.h:7308
#define IS_TIM_CC2_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8928
#define TIM_CCMR3_OC5CE
Definition: stm32f745xx.h:7297
#define TIM_IT_CC2
#define TIM_OCPOLARITY_HIGH
#define TIM_OCMODE_PWM2
#define TIM_CCMR1_OC1CE
Definition: stm32f745xx.h:7095
#define TIM_SMCR_ETF
Definition: stm32f745xx.h:7025
#define TIM_SMCR_ETP
Definition: stm32f745xx.h:7036
#define IS_TIM_CLOCKDIVISION_DIV(__DIV__)
#define TIM_TRGO_OC2REF
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
#define TIM_CR2_CCUS
Definition: stm32f745xx.h:6984
#define TIM_CCMR3_OC6FE
Definition: stm32f745xx.h:7299
#define UNUSED(x)
#define TIM_BDTR_OSSI
Definition: stm32f745xx.h:7250
#define TIM_CCMR2_OC4PE
Definition: stm32f745xx.h:7157
TIM Time Base Handle Structure definition.
#define TIM_CCMR3_OC6M
Definition: stm32f745xx.h:7302
#define TIM_CCER_CC3NE
Definition: stm32f745xx.h:7200
void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure)
__IO uint32_t CCR3
Definition: stm32f745xx.h:896
#define IS_TIM_TRGO2_SOURCE(SOURCE)
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
#define TIM_CR2_OIS5
Definition: stm32f745xx.h:6987
#define TIM_CR2_TI1S
Definition: stm32f745xx.h:7001
#define IS_TIM_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8898
#define IS_TIM_CLEARINPUT_POLARITY(__POLARITY__)
#define IS_TIM_IC_FILTER(ICFILTER)
HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap)
#define TIM_CHANNEL_6
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
#define TIM_BDTR_BK2F
Definition: stm32f745xx.h:7257
#define TIM_IT_COM
#define IS_TIM_LOCK_LEVEL(__LEVEL__)
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig)
#define IS_TIM_BREAK_FILTER(__FILTER__)
TIM_TypeDef * Instance
DMA handle Structure definition.
#define TIM_SMCR_MSM
Definition: stm32f745xx.h:7023
#define IS_TIM_CC4_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8946
#define TIM_TS_ITR2
__IO uint32_t CCR2
Definition: stm32f745xx.h:895
#define TIM_SMCR_SMS
Definition: stm32f745xx.h:7011
#define TIM_BDTR_BK2P
Definition: stm32f745xx.h:7259
#define TIM_TS_TI1F_ED
#define IS_TIM_CLEARINPUT_PRESCALER(__PRESCALER__)
HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim)
#define IS_TIM_BREAK_POLARITY(__POLARITY__)
#define IS_TIM_CHANNELS(CHANNEL)
#define TIM_TS_ITR1
TIM_Base_InitTypeDef Init
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
__IO uint32_t CCR6
Definition: stm32f745xx.h:904
#define TIM1_AF1_BKDF1BKE
Definition: stm32f765xx.h:7662
#define __HAL_TIM_DISABLE_IT(__HANDLE__, __INTERRUPT__)
#define IS_TIM_BREAK2_POLARITY(__POLARITY__)
#define IS_TIM_SYNCHRO_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:9160
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
__IO uint32_t OR
Definition: stm32f745xx.h:901
HAL_StatusTypeDef
HAL Status structures definition.
#define TIM_CCMR1_OC1PE
Definition: stm32f745xx.h:7087
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
#define TIM_CCMR2_OC3FE
Definition: stm32f745xx.h:7139
#define __HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__)
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim)
void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
#define TIM_CCMR2_OC4FE
Definition: stm32f745xx.h:7156
#define TIM_CCxN_DISABLE
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length)
#define IS_TIM_REMAP_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:9080
#define TIM_CCR5_GC5C1
Definition: stm32f745xx.h:7312
#define TIM_CCMR1_IC1PSC
Definition: stm32f745xx.h:7114
#define __HAL_TIM_ENABLE(__HANDLE__)
Enable the TIM peripheral.
void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter)
#define IS_TIM_PWM_MODE(MODE)
#define TIM_CCMR3_OC5M
Definition: stm32f745xx.h:7291
#define TIM_CR2_MMS
Definition: stm32f745xx.h:6990
#define TIM_OCNPOLARITY_HIGH
#define TIM_DMA_ID_COMMUTATION
void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma)
#define IS_TIM_REMAP(__TIM_REMAP__)
#define TIM_CCxN_ENABLE
#define TIM_OCIDLESTATE_RESET
#define IS_TIM_IC_PRESCALER(__PRESCALER__)
#define TIM_BDTR_OSSR
Definition: stm32f745xx.h:7251
#define IS_TIM_CC1_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:8914
#define TIM_BDTR_MOE
Definition: stm32f745xx.h:7255
__IO uint32_t CCMR2
Definition: stm32f745xx.h:888
#define IS_TIM_TRGO2_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:9155
#define IS_TIM_AUTOMATIC_OUTPUT_STATE(__STATE__)