STM32L4xx_HAL_Driver  1.14.0
TIM Private Functions

Private functions. More...

Functions

static ErrorStatus OC1Config (TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
 Configure the TIMx output channel 1. More...
 
static ErrorStatus OC2Config (TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
 Configure the TIMx output channel 2. More...
 
static ErrorStatus OC3Config (TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
 Configure the TIMx output channel 3. More...
 
static ErrorStatus OC4Config (TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
 Configure the TIMx output channel 4. More...
 
static ErrorStatus OC5Config (TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
 Configure the TIMx output channel 5. More...
 
static ErrorStatus OC6Config (TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
 Configure the TIMx output channel 6. More...
 
static ErrorStatus IC1Config (TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
 Configure the TIMx input channel 1. More...
 
static ErrorStatus IC2Config (TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
 Configure the TIMx input channel 2. More...
 
static ErrorStatus IC3Config (TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
 Configure the TIMx input channel 3. More...
 
static ErrorStatus IC4Config (TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
 Configure the TIMx input channel 4. More...
 

Detailed Description

Private functions.

Function Documentation

◆ IC1Config()

static ErrorStatus IC1Config ( TIM_TypeDef *  TIMx,
LL_TIM_IC_InitTypeDef TIM_ICInitStruct 
)
static

Configure the TIMx input channel 1.

Parameters
TIMxTimer Instance
TIM_ICInitStructpointer to the the TIMx input channel 1 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1210 of file stm32l4xx_ll_tim.c.

1211 {
1212  /* Check the parameters */
1213  assert_param(IS_TIM_CC1_INSTANCE(TIMx));
1214  assert_param(IS_LL_TIM_IC_POLARITY(TIM_ICInitStruct->ICPolarity));
1215  assert_param(IS_LL_TIM_ACTIVEINPUT(TIM_ICInitStruct->ICActiveInput));
1216  assert_param(IS_LL_TIM_ICPSC(TIM_ICInitStruct->ICPrescaler));
1217  assert_param(IS_LL_TIM_IC_FILTER(TIM_ICInitStruct->ICFilter));
1218 
1219  /* Disable the Channel 1: Reset the CC1E Bit */
1220  TIMx->CCER &= (uint32_t)~TIM_CCER_CC1E;
1221 
1222  /* Select the Input and set the filter and the prescaler value */
1223  MODIFY_REG(TIMx->CCMR1,
1224  (TIM_CCMR1_CC1S | TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC),
1225  (TIM_ICInitStruct->ICActiveInput | TIM_ICInitStruct->ICFilter | TIM_ICInitStruct->ICPrescaler) >> 16U);
1226 
1227  /* Select the Polarity and set the CC1E Bit */
1228  MODIFY_REG(TIMx->CCER,
1229  (TIM_CCER_CC1P | TIM_CCER_CC1NP),
1230  (TIM_ICInitStruct->ICPolarity | TIM_CCER_CC1E));
1231 
1232  return SUCCESS;
1233 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ IC2Config()

static ErrorStatus IC2Config ( TIM_TypeDef *  TIMx,
LL_TIM_IC_InitTypeDef TIM_ICInitStruct 
)
static

Configure the TIMx input channel 2.

Parameters
TIMxTimer Instance
TIM_ICInitStructpointer to the the TIMx input channel 2 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1243 of file stm32l4xx_ll_tim.c.

1244 {
1245  /* Check the parameters */
1246  assert_param(IS_TIM_CC2_INSTANCE(TIMx));
1247  assert_param(IS_LL_TIM_IC_POLARITY(TIM_ICInitStruct->ICPolarity));
1248  assert_param(IS_LL_TIM_ACTIVEINPUT(TIM_ICInitStruct->ICActiveInput));
1249  assert_param(IS_LL_TIM_ICPSC(TIM_ICInitStruct->ICPrescaler));
1250  assert_param(IS_LL_TIM_IC_FILTER(TIM_ICInitStruct->ICFilter));
1251 
1252  /* Disable the Channel 2: Reset the CC2E Bit */
1253  TIMx->CCER &= (uint32_t)~TIM_CCER_CC2E;
1254 
1255  /* Select the Input and set the filter and the prescaler value */
1256  MODIFY_REG(TIMx->CCMR1,
1257  (TIM_CCMR1_CC2S | TIM_CCMR1_IC2F | TIM_CCMR1_IC2PSC),
1258  (TIM_ICInitStruct->ICActiveInput | TIM_ICInitStruct->ICFilter | TIM_ICInitStruct->ICPrescaler) >> 8U);
1259 
1260  /* Select the Polarity and set the CC2E Bit */
1261  MODIFY_REG(TIMx->CCER,
1262  (TIM_CCER_CC2P | TIM_CCER_CC2NP),
1263  ((TIM_ICInitStruct->ICPolarity << 4U) | TIM_CCER_CC2E));
1264 
1265  return SUCCESS;
1266 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ IC3Config()

static ErrorStatus IC3Config ( TIM_TypeDef *  TIMx,
LL_TIM_IC_InitTypeDef TIM_ICInitStruct 
)
static

Configure the TIMx input channel 3.

Parameters
TIMxTimer Instance
TIM_ICInitStructpointer to the the TIMx input channel 3 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1276 of file stm32l4xx_ll_tim.c.

1277 {
1278  /* Check the parameters */
1279  assert_param(IS_TIM_CC3_INSTANCE(TIMx));
1280  assert_param(IS_LL_TIM_IC_POLARITY(TIM_ICInitStruct->ICPolarity));
1281  assert_param(IS_LL_TIM_ACTIVEINPUT(TIM_ICInitStruct->ICActiveInput));
1282  assert_param(IS_LL_TIM_ICPSC(TIM_ICInitStruct->ICPrescaler));
1283  assert_param(IS_LL_TIM_IC_FILTER(TIM_ICInitStruct->ICFilter));
1284 
1285  /* Disable the Channel 3: Reset the CC3E Bit */
1286  TIMx->CCER &= (uint32_t)~TIM_CCER_CC3E;
1287 
1288  /* Select the Input and set the filter and the prescaler value */
1289  MODIFY_REG(TIMx->CCMR2,
1290  (TIM_CCMR2_CC3S | TIM_CCMR2_IC3F | TIM_CCMR2_IC3PSC),
1291  (TIM_ICInitStruct->ICActiveInput | TIM_ICInitStruct->ICFilter | TIM_ICInitStruct->ICPrescaler) >> 16U);
1292 
1293  /* Select the Polarity and set the CC3E Bit */
1294  MODIFY_REG(TIMx->CCER,
1295  (TIM_CCER_CC3P | TIM_CCER_CC3NP),
1296  ((TIM_ICInitStruct->ICPolarity << 8U) | TIM_CCER_CC3E));
1297 
1298  return SUCCESS;
1299 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ IC4Config()

static ErrorStatus IC4Config ( TIM_TypeDef *  TIMx,
LL_TIM_IC_InitTypeDef TIM_ICInitStruct 
)
static

Configure the TIMx input channel 4.

Parameters
TIMxTimer Instance
TIM_ICInitStructpointer to the the TIMx input channel 4 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1309 of file stm32l4xx_ll_tim.c.

1310 {
1311  /* Check the parameters */
1312  assert_param(IS_TIM_CC4_INSTANCE(TIMx));
1313  assert_param(IS_LL_TIM_IC_POLARITY(TIM_ICInitStruct->ICPolarity));
1314  assert_param(IS_LL_TIM_ACTIVEINPUT(TIM_ICInitStruct->ICActiveInput));
1315  assert_param(IS_LL_TIM_ICPSC(TIM_ICInitStruct->ICPrescaler));
1316  assert_param(IS_LL_TIM_IC_FILTER(TIM_ICInitStruct->ICFilter));
1317 
1318  /* Disable the Channel 4: Reset the CC4E Bit */
1319  TIMx->CCER &= (uint32_t)~TIM_CCER_CC4E;
1320 
1321  /* Select the Input and set the filter and the prescaler value */
1322  MODIFY_REG(TIMx->CCMR2,
1323  (TIM_CCMR2_CC4S | TIM_CCMR2_IC4F | TIM_CCMR2_IC4PSC),
1324  (TIM_ICInitStruct->ICActiveInput | TIM_ICInitStruct->ICFilter | TIM_ICInitStruct->ICPrescaler) >> 8U);
1325 
1326  /* Select the Polarity and set the CC2E Bit */
1327  MODIFY_REG(TIMx->CCER,
1328  (TIM_CCER_CC4P | TIM_CCER_CC4NP),
1329  ((TIM_ICInitStruct->ICPolarity << 12U) | TIM_CCER_CC4E));
1330 
1331  return SUCCESS;
1332 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ OC1Config()

static ErrorStatus OC1Config ( TIM_TypeDef *  TIMx,
LL_TIM_OC_InitTypeDef TIM_OCInitStruct 
)
static

Configure the TIMx output channel 1.

Parameters
TIMxTimer Instance
TIM_OCInitStructpointer to the the TIMx output channel 1 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 782 of file stm32l4xx_ll_tim.c.

783 {
784  uint32_t tmpccmr1;
785  uint32_t tmpccer;
786  uint32_t tmpcr2;
787 
788  /* Check the parameters */
789  assert_param(IS_TIM_CC1_INSTANCE(TIMx));
790  assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
791  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
792  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
793  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
794  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
795 
796  /* Disable the Channel 1: Reset the CC1E Bit */
797  CLEAR_BIT(TIMx->CCER, TIM_CCER_CC1E);
798 
799  /* Get the TIMx CCER register value */
800  tmpccer = LL_TIM_ReadReg(TIMx, CCER);
801 
802  /* Get the TIMx CR2 register value */
803  tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
804 
805  /* Get the TIMx CCMR1 register value */
806  tmpccmr1 = LL_TIM_ReadReg(TIMx, CCMR1);
807 
808  /* Reset Capture/Compare selection Bits */
809  CLEAR_BIT(tmpccmr1, TIM_CCMR1_CC1S);
810 
811  /* Set the Output Compare Mode */
812  MODIFY_REG(tmpccmr1, TIM_CCMR1_OC1M, TIM_OCInitStruct->OCMode);
813 
814  /* Set the Output Compare Polarity */
815  MODIFY_REG(tmpccer, TIM_CCER_CC1P, TIM_OCInitStruct->OCPolarity);
816 
817  /* Set the Output State */
818  MODIFY_REG(tmpccer, TIM_CCER_CC1E, TIM_OCInitStruct->OCState);
819 
820  if (IS_TIM_BREAK_INSTANCE(TIMx))
821  {
822  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
823  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
824 
825  /* Set the complementary output Polarity */
826  MODIFY_REG(tmpccer, TIM_CCER_CC1NP, TIM_OCInitStruct->OCNPolarity << 2U);
827 
828  /* Set the complementary output State */
829  MODIFY_REG(tmpccer, TIM_CCER_CC1NE, TIM_OCInitStruct->OCNState << 2U);
830 
831  /* Set the Output Idle state */
832  MODIFY_REG(tmpcr2, TIM_CR2_OIS1, TIM_OCInitStruct->OCIdleState);
833 
834  /* Set the complementary output Idle state */
835  MODIFY_REG(tmpcr2, TIM_CR2_OIS1N, TIM_OCInitStruct->OCNIdleState << 1U);
836  }
837 
838  /* Write to TIMx CR2 */
839  LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
840 
841  /* Write to TIMx CCMR1 */
842  LL_TIM_WriteReg(TIMx, CCMR1, tmpccmr1);
843 
844  /* Set the Capture Compare Register value */
845  LL_TIM_OC_SetCompareCH1(TIMx, TIM_OCInitStruct->CompareValue);
846 
847  /* Write to TIMx CCER */
848  LL_TIM_WriteReg(TIMx, CCER, tmpccer);
849 
850  return SUCCESS;
851 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
__STATIC_INLINE void LL_TIM_OC_SetCompareCH1(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 1 (TIMx_CCR1).

◆ OC2Config()

static ErrorStatus OC2Config ( TIM_TypeDef *  TIMx,
LL_TIM_OC_InitTypeDef TIM_OCInitStruct 
)
static

Configure the TIMx output channel 2.

Parameters
TIMxTimer Instance
TIM_OCInitStructpointer to the the TIMx output channel 2 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 861 of file stm32l4xx_ll_tim.c.

862 {
863  uint32_t tmpccmr1;
864  uint32_t tmpccer;
865  uint32_t tmpcr2;
866 
867  /* Check the parameters */
868  assert_param(IS_TIM_CC2_INSTANCE(TIMx));
869  assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
870  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
871  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
872  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
873  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
874 
875  /* Disable the Channel 2: Reset the CC2E Bit */
876  CLEAR_BIT(TIMx->CCER, TIM_CCER_CC2E);
877 
878  /* Get the TIMx CCER register value */
879  tmpccer = LL_TIM_ReadReg(TIMx, CCER);
880 
881  /* Get the TIMx CR2 register value */
882  tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
883 
884  /* Get the TIMx CCMR1 register value */
885  tmpccmr1 = LL_TIM_ReadReg(TIMx, CCMR1);
886 
887  /* Reset Capture/Compare selection Bits */
888  CLEAR_BIT(tmpccmr1, TIM_CCMR1_CC2S);
889 
890  /* Select the Output Compare Mode */
891  MODIFY_REG(tmpccmr1, TIM_CCMR1_OC2M, TIM_OCInitStruct->OCMode << 8U);
892 
893  /* Set the Output Compare Polarity */
894  MODIFY_REG(tmpccer, TIM_CCER_CC2P, TIM_OCInitStruct->OCPolarity << 4U);
895 
896  /* Set the Output State */
897  MODIFY_REG(tmpccer, TIM_CCER_CC2E, TIM_OCInitStruct->OCState << 4U);
898 
899  if (IS_TIM_BREAK_INSTANCE(TIMx))
900  {
901  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
902  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
903 
904  /* Set the complementary output Polarity */
905  MODIFY_REG(tmpccer, TIM_CCER_CC2NP, TIM_OCInitStruct->OCNPolarity << 6U);
906 
907  /* Set the complementary output State */
908  MODIFY_REG(tmpccer, TIM_CCER_CC2NE, TIM_OCInitStruct->OCNState << 6U);
909 
910  /* Set the Output Idle state */
911  MODIFY_REG(tmpcr2, TIM_CR2_OIS2, TIM_OCInitStruct->OCIdleState << 2U);
912 
913  /* Set the complementary output Idle state */
914  MODIFY_REG(tmpcr2, TIM_CR2_OIS2N, TIM_OCInitStruct->OCNIdleState << 3U);
915  }
916 
917  /* Write to TIMx CR2 */
918  LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
919 
920  /* Write to TIMx CCMR1 */
921  LL_TIM_WriteReg(TIMx, CCMR1, tmpccmr1);
922 
923  /* Set the Capture Compare Register value */
924  LL_TIM_OC_SetCompareCH2(TIMx, TIM_OCInitStruct->CompareValue);
925 
926  /* Write to TIMx CCER */
927  LL_TIM_WriteReg(TIMx, CCER, tmpccer);
928 
929  return SUCCESS;
930 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
__STATIC_INLINE void LL_TIM_OC_SetCompareCH2(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 2 (TIMx_CCR2).

◆ OC3Config()

static ErrorStatus OC3Config ( TIM_TypeDef *  TIMx,
LL_TIM_OC_InitTypeDef TIM_OCInitStruct 
)
static

Configure the TIMx output channel 3.

Parameters
TIMxTimer Instance
TIM_OCInitStructpointer to the the TIMx output channel 3 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 940 of file stm32l4xx_ll_tim.c.

941 {
942  uint32_t tmpccmr2;
943  uint32_t tmpccer;
944  uint32_t tmpcr2;
945 
946  /* Check the parameters */
947  assert_param(IS_TIM_CC3_INSTANCE(TIMx));
948  assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
949  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
950  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
951  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
952  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
953 
954  /* Disable the Channel 3: Reset the CC3E Bit */
955  CLEAR_BIT(TIMx->CCER, TIM_CCER_CC3E);
956 
957  /* Get the TIMx CCER register value */
958  tmpccer = LL_TIM_ReadReg(TIMx, CCER);
959 
960  /* Get the TIMx CR2 register value */
961  tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
962 
963  /* Get the TIMx CCMR2 register value */
964  tmpccmr2 = LL_TIM_ReadReg(TIMx, CCMR2);
965 
966  /* Reset Capture/Compare selection Bits */
967  CLEAR_BIT(tmpccmr2, TIM_CCMR2_CC3S);
968 
969  /* Select the Output Compare Mode */
970  MODIFY_REG(tmpccmr2, TIM_CCMR2_OC3M, TIM_OCInitStruct->OCMode);
971 
972  /* Set the Output Compare Polarity */
973  MODIFY_REG(tmpccer, TIM_CCER_CC3P, TIM_OCInitStruct->OCPolarity << 8U);
974 
975  /* Set the Output State */
976  MODIFY_REG(tmpccer, TIM_CCER_CC3E, TIM_OCInitStruct->OCState << 8U);
977 
978  if (IS_TIM_BREAK_INSTANCE(TIMx))
979  {
980  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
981  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
982 
983  /* Set the complementary output Polarity */
984  MODIFY_REG(tmpccer, TIM_CCER_CC3NP, TIM_OCInitStruct->OCNPolarity << 10U);
985 
986  /* Set the complementary output State */
987  MODIFY_REG(tmpccer, TIM_CCER_CC3NE, TIM_OCInitStruct->OCNState << 10U);
988 
989  /* Set the Output Idle state */
990  MODIFY_REG(tmpcr2, TIM_CR2_OIS3, TIM_OCInitStruct->OCIdleState << 4U);
991 
992  /* Set the complementary output Idle state */
993  MODIFY_REG(tmpcr2, TIM_CR2_OIS3N, TIM_OCInitStruct->OCNIdleState << 5U);
994  }
995 
996  /* Write to TIMx CR2 */
997  LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
998 
999  /* Write to TIMx CCMR2 */
1000  LL_TIM_WriteReg(TIMx, CCMR2, tmpccmr2);
1001 
1002  /* Set the Capture Compare Register value */
1003  LL_TIM_OC_SetCompareCH3(TIMx, TIM_OCInitStruct->CompareValue);
1004 
1005  /* Write to TIMx CCER */
1006  LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1007 
1008  return SUCCESS;
1009 }
__STATIC_INLINE void LL_TIM_OC_SetCompareCH3(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 3 (TIMx_CCR3).
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ OC4Config()

static ErrorStatus OC4Config ( TIM_TypeDef *  TIMx,
LL_TIM_OC_InitTypeDef TIM_OCInitStruct 
)
static

Configure the TIMx output channel 4.

Parameters
TIMxTimer Instance
TIM_OCInitStructpointer to the the TIMx output channel 4 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1019 of file stm32l4xx_ll_tim.c.

1020 {
1021  uint32_t tmpccmr2;
1022  uint32_t tmpccer;
1023  uint32_t tmpcr2;
1024 
1025  /* Check the parameters */
1026  assert_param(IS_TIM_CC4_INSTANCE(TIMx));
1027  assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
1028  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
1029  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
1030  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
1031  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
1032 
1033  /* Disable the Channel 4: Reset the CC4E Bit */
1034  CLEAR_BIT(TIMx->CCER, TIM_CCER_CC4E);
1035 
1036  /* Get the TIMx CCER register value */
1037  tmpccer = LL_TIM_ReadReg(TIMx, CCER);
1038 
1039  /* Get the TIMx CR2 register value */
1040  tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
1041 
1042  /* Get the TIMx CCMR2 register value */
1043  tmpccmr2 = LL_TIM_ReadReg(TIMx, CCMR2);
1044 
1045  /* Reset Capture/Compare selection Bits */
1046  CLEAR_BIT(tmpccmr2, TIM_CCMR2_CC4S);
1047 
1048  /* Select the Output Compare Mode */
1049  MODIFY_REG(tmpccmr2, TIM_CCMR2_OC4M, TIM_OCInitStruct->OCMode << 8U);
1050 
1051  /* Set the Output Compare Polarity */
1052  MODIFY_REG(tmpccer, TIM_CCER_CC4P, TIM_OCInitStruct->OCPolarity << 12U);
1053 
1054  /* Set the Output State */
1055  MODIFY_REG(tmpccer, TIM_CCER_CC4E, TIM_OCInitStruct->OCState << 12U);
1056 
1057  if (IS_TIM_BREAK_INSTANCE(TIMx))
1058  {
1059  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
1060  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
1061 
1062  /* Set the Output Idle state */
1063  MODIFY_REG(tmpcr2, TIM_CR2_OIS4, TIM_OCInitStruct->OCIdleState << 6U);
1064  }
1065 
1066  /* Write to TIMx CR2 */
1067  LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
1068 
1069  /* Write to TIMx CCMR2 */
1070  LL_TIM_WriteReg(TIMx, CCMR2, tmpccmr2);
1071 
1072  /* Set the Capture Compare Register value */
1073  LL_TIM_OC_SetCompareCH4(TIMx, TIM_OCInitStruct->CompareValue);
1074 
1075  /* Write to TIMx CCER */
1076  LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1077 
1078  return SUCCESS;
1079 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
__STATIC_INLINE void LL_TIM_OC_SetCompareCH4(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 4 (TIMx_CCR4).

◆ OC5Config()

static ErrorStatus OC5Config ( TIM_TypeDef *  TIMx,
LL_TIM_OC_InitTypeDef TIM_OCInitStruct 
)
static

Configure the TIMx output channel 5.

Parameters
TIMxTimer Instance
TIM_OCInitStructpointer to the the TIMx output channel 5 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1089 of file stm32l4xx_ll_tim.c.

1090 {
1091  uint32_t tmpccmr3;
1092  uint32_t tmpccer;
1093 
1094  /* Check the parameters */
1095  assert_param(IS_TIM_CC5_INSTANCE(TIMx));
1096  assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
1097  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
1098  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
1099  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
1100  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
1101 
1102  /* Disable the Channel 5: Reset the CC5E Bit */
1103  CLEAR_BIT(TIMx->CCER, TIM_CCER_CC5E);
1104 
1105  /* Get the TIMx CCER register value */
1106  tmpccer = LL_TIM_ReadReg(TIMx, CCER);
1107 
1108  /* Get the TIMx CCMR3 register value */
1109  tmpccmr3 = LL_TIM_ReadReg(TIMx, CCMR3);
1110 
1111  /* Select the Output Compare Mode */
1112  MODIFY_REG(tmpccmr3, TIM_CCMR3_OC5M, TIM_OCInitStruct->OCMode);
1113 
1114  /* Set the Output Compare Polarity */
1115  MODIFY_REG(tmpccer, TIM_CCER_CC5P, TIM_OCInitStruct->OCPolarity << 16U);
1116 
1117  /* Set the Output State */
1118  MODIFY_REG(tmpccer, TIM_CCER_CC5E, TIM_OCInitStruct->OCState << 16U);
1119 
1120  if (IS_TIM_BREAK_INSTANCE(TIMx))
1121  {
1122  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
1123  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
1124 
1125  /* Set the Output Idle state */
1126  MODIFY_REG(TIMx->CR2, TIM_CR2_OIS5, TIM_OCInitStruct->OCIdleState << 8U);
1127 
1128  }
1129 
1130  /* Write to TIMx CCMR3 */
1131  LL_TIM_WriteReg(TIMx, CCMR3, tmpccmr3);
1132 
1133  /* Set the Capture Compare Register value */
1134  LL_TIM_OC_SetCompareCH5(TIMx, TIM_OCInitStruct->CompareValue);
1135 
1136  /* Write to TIMx CCER */
1137  LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1138 
1139  return SUCCESS;
1140 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
__STATIC_INLINE void LL_TIM_OC_SetCompareCH5(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 5 (TIMx_CCR5).
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ OC6Config()

static ErrorStatus OC6Config ( TIM_TypeDef *  TIMx,
LL_TIM_OC_InitTypeDef TIM_OCInitStruct 
)
static

Configure the TIMx output channel 6.

Parameters
TIMxTimer Instance
TIM_OCInitStructpointer to the the TIMx output channel 6 configuration data structure
Return values
AnErrorStatus enumeration value:
  • SUCCESS: TIMx registers are de-initialized
  • ERROR: not applicable

Definition at line 1150 of file stm32l4xx_ll_tim.c.

1151 {
1152  uint32_t tmpccmr3;
1153  uint32_t tmpccer;
1154 
1155  /* Check the parameters */
1156  assert_param(IS_TIM_CC6_INSTANCE(TIMx));
1157  assert_param(IS_LL_TIM_OCMODE(TIM_OCInitStruct->OCMode));
1158  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCState));
1159  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCPolarity));
1160  assert_param(IS_LL_TIM_OCPOLARITY(TIM_OCInitStruct->OCNPolarity));
1161  assert_param(IS_LL_TIM_OCSTATE(TIM_OCInitStruct->OCNState));
1162 
1163  /* Disable the Channel 5: Reset the CC6E Bit */
1164  CLEAR_BIT(TIMx->CCER, TIM_CCER_CC6E);
1165 
1166  /* Get the TIMx CCER register value */
1167  tmpccer = LL_TIM_ReadReg(TIMx, CCER);
1168 
1169  /* Get the TIMx CCMR3 register value */
1170  tmpccmr3 = LL_TIM_ReadReg(TIMx, CCMR3);
1171 
1172  /* Select the Output Compare Mode */
1173  MODIFY_REG(tmpccmr3, TIM_CCMR3_OC6M, TIM_OCInitStruct->OCMode << 8U);
1174 
1175  /* Set the Output Compare Polarity */
1176  MODIFY_REG(tmpccer, TIM_CCER_CC6P, TIM_OCInitStruct->OCPolarity << 20U);
1177 
1178  /* Set the Output State */
1179  MODIFY_REG(tmpccer, TIM_CCER_CC6E, TIM_OCInitStruct->OCState << 20U);
1180 
1181  if (IS_TIM_BREAK_INSTANCE(TIMx))
1182  {
1183  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCNIdleState));
1184  assert_param(IS_LL_TIM_OCIDLESTATE(TIM_OCInitStruct->OCIdleState));
1185 
1186  /* Set the Output Idle state */
1187  MODIFY_REG(TIMx->CR2, TIM_CR2_OIS6, TIM_OCInitStruct->OCIdleState << 10U);
1188  }
1189 
1190  /* Write to TIMx CCMR3 */
1191  LL_TIM_WriteReg(TIMx, CCMR3, tmpccmr3);
1192 
1193  /* Set the Capture Compare Register value */
1194  LL_TIM_OC_SetCompareCH6(TIMx, TIM_OCInitStruct->CompareValue);
1195 
1196  /* Write to TIMx CCER */
1197  LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1198 
1199  return SUCCESS;
1200 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
__STATIC_INLINE void LL_TIM_OC_SetCompareCH6(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 6 (TIMx_CCR6).
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))