| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587 |
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 1
- C51 COMPILER V9.60.7.0, COMPILATION OF MODULE TIMER
- OBJECT MODULE PLACED IN .\Objects\timer.obj
- COMPILER INVOKED BY: d:\Keil_v5\C51\BIN\C51.EXE ..\..\..\..\driver\src\timer.c OBJECTADVANCED OPTIMIZE(9,SPEED) BROWSE O
- -RDER NOAREGS MODC2 INCDIR(..\..\..\..\driver\inc;..\..\..\..\mcu;..\..\..\..\middleware\log;..\..\..\..\middleware\delay
- -;..\..\..\..\middleware\rf_basis) DEBUG PRINT(.\Listings\timer.lst) TABS(2) OBJECT(.\Objects\timer.obj)
- line level source
- 1 /**
- 2 ************************************************************************
- 3 * @file timer.c
- 4 * @author Panchip Team
- 5 * @version V0.5
- 6 * @date 2024-04-28
- 7 * @brief This file provides all the timer firmware functions.
- 8 * @note
- 9 * Copyright (C) 2024 Panchip Technology Corp. All rights reserved.
- 10 ****************************************************************************
- 11 */
- 12
- 13 #include "timer.h"
- 14
- 15 /** @addtogroup PAN262x_Std_Driver
- 16 * @{
- 17 */
- 18
- 19 /** @defgroup TIMER
- 20 * @brief TIMER driver modules
- 21 * @{
- 22 */
- 23
- 24 /** @defgroup TIMER_Private_Functions
- 25 * @{
- 26 */
- 27
- 28 /**
- 29 * @brief Deinitializes the TIMx peripheral registers to their default reset values.
- 30 * @param TIMx: where x can be 0 to 2 to select the TIM peripheral.
- 31 * @retval None
- 32 */
- 33 void TIM_DeInit(TIM_IdTypeDef TIMERx)
- 34 {
- 35 1 /* Check the parameters */
- 36 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 37 1
- 38 1 if (TIMERx == TIMER0)
- 39 1 {
- 40 2 TR0 = 0;
- 41 2 TF0 = 0;
- 42 2 TL0 = 0;
- 43 2 TH0 = 0;
- 44 2 TMOD &= ~0x0F;
- 45 2 }
- 46 1 else if (TIMERx == TIMER1)
- 47 1 {
- 48 2 TR1 = 0;
- 49 2 TF1 = 0;
- 50 2 TL1 = 0;
- 51 2 TH1 = 0;
- 52 2 TMOD &= ~0xF0;
- 53 2 }
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 2
- 54 1 else if (TIMERx == TIMER2)
- 55 1 {
- 56 2 T2CON = 0;
- 57 2 CCEN = 0;
- 58 2 TL2 = 0;
- 59 2 TH2 = 0;
- 60 2 TCAPCON = 0;
- 61 2 TCAPSTA = 0;
- 62 2 CRCH = 0;
- 63 2 CRCL = 0;
- 64 2 CCH1 = 0;
- 65 2 CCL1 = 0;
- 66 2 CCH2 = 0;
- 67 2 CCL2 = 0;
- 68 2 CCH3 = 0;
- 69 2 CCL3 = 0;
- 70 2 }
- 71 1 }
- 72
- 73 /**
- 74 * @brief Initializes the TIMERx Time Base Unit peripheral according to
- 75 * the specified parameters in the TIM_TimeBaseInitStruct.
- 76 * @param TIMERx: where x can be 0 to 2 to select the TIM peripheral.
- 77 * @param TIM_Mode: specifies the workmode of timer.
- 78 * This parameter can be a value of @ref TIM_ModeTypeDef
- 79 * @param TIM_Clk: Specifies the clock division.
- 80 * This parameter can be a value of @ref TIM_ClkDivTypeDef
- 81 * @param InitCnt: specifies the Counter register initial value.
- 82 * @retval None
- 83 */
- 84 void TIM_TimeBaseInit(TIM_IdTypeDef TIMERx, TIM_ModeTypeDef TIM_Mode, TIM_ClkDivTypeDef TIM_Clk, u16 InitC
- -nt)
- 85 {
- 86 1 /* Check the parameters */
- 87 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 88 1
- 89 1 if (TIMERx == TIMER0)
- 90 1 {
- 91 2 /* set timer0 disable */
- 92 2 TR0 = 0;
- 93 2
- 94 2 /* set timer0 initial count */
- 95 2 if (TIM_Mode == TIM0_Mode2_8BitAutoReload)
- 96 2 {
- 97 3 TH0 = InitCnt & 0xff;
- 98 3 TL0 = TH0;
- 99 3 }
- 100 2 else
- 101 2 {
- 102 3 TIM_SET_VAL(TH0, TL0, InitCnt);
- 103 3 }
- 104 2
- 105 2 /* set timer0 basetime enable */
- 106 2 MODIFY_REG(TMOD, TMOD_TIM0_CT_Msk, 0 << TMOD_TIM0_CT_Pos);
- 107 2
- 108 2 /* set timer0 workmode */
- 109 2 MODIFY_REG(TMOD, TMOD_TIM0_MODE_Msk, TIM_Mode << TMOD_TIM0_MODE_Pos);
- 110 2 }
- 111 1 else if (TIMERx == TIMER1)
- 112 1 {
- 113 2 /* set timer1 disable */
- 114 2 TR1 = 0;
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 3
- 115 2
- 116 2 /* set timer1 initial count */
- 117 2 if (TIM_Mode == TIM1_Mode2_8BitAutoReload)
- 118 2 {
- 119 3 TH1 = InitCnt & 0xff;
- 120 3 TL1 = TH1;
- 121 3 }
- 122 2 else
- 123 2 {
- 124 3 TIM_SET_VAL(TH1, TL1, InitCnt);
- 125 3 }
- 126 2
- 127 2 /* set timer1 basetime enable */
- 128 2 MODIFY_REG(TMOD, TMOD_TIM1_CT_Msk, 0 << TMOD_TIM1_CT_Pos);
- 129 2
- 130 2 /* set timer1 workmode */
- 131 2 MODIFY_REG(TMOD, TMOD_TIM1_MODE_Msk, TIM_Mode << TMOD_TIM1_MODE_Pos);
- 132 2 }
- 133 1 else if (TIMERx == TIMER2)
- 134 1 {
- 135 2 /* set timer2 disable */
- 136 2 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_STOP << T2CON_T2I_Pos);
- 137 2
- 138 2 /* set timer2 initial count */
- 139 2 TIM_SET_VAL(TH2, TL2, InitCnt);
- 140 2
- 141 2 /* set timer2 reload count */
- 142 2 TIM_SET_VAL(CRCH, CRCL, InitCnt);
- 143 2
- 144 2 /* set timer2 clock division */
- 145 2 MODIFY_REG(T2CON, T2CON_T2PS_Msk, TIM_Clk << T2CON_T2PS_Pos);
- 146 2
- 147 2 if (TIM2_Mode0_16BitAutoReload == TIM_Mode)
- 148 2 {
- 149 3 /* set timer2 reload mode0 */
- 150 3 MODIFY_REG(T2CON, T2CON_T2R_Msk, TIM2_RELOAD_MODE0 << T2CON_T2R_Pos);
- 151 3 }
- 152 2 else
- 153 2 {
- 154 3 /* set timer2 reload mode0 */
- 155 3 MODIFY_REG(T2CON, T2CON_T2R_Msk, TIM2_RELOAD_DISABLE << T2CON_T2R_Pos);
- 156 3 }
- 157 2 }
- 158 1 }
- 159
- 160 /**
- 161 * @brief Enables or disables TIMERx peripheral external signal count function.
- 162 * @param TIMERx: where x can be 0 to 2 to select the TIM peripheral.
- 163 * @param TIM_Mode: specifies the workmode of timer.
- 164 * This parameter can be a value of @ref TIM_ModeTypeDef
- 165 * @param NewState: new state of the TIMERx peripheral count function.
- 166 * This parameter can be: ENABLE or DISABLE.
- 167 * @retval None
- 168 */
- 169 void TIM_ExtCntConfig(TIM_IdTypeDef TIMERx, FunctionalState NewState)
- 170 {
- 171 1 /* Check the parameters */
- 172 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 173 1 assert_param(IS_FUNCTIONAL_STATE(NewState));
- 174 1
- 175 1 switch (TIMERx)
- 176 1 {
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 4
- 177 2 case TIMER0:
- 178 2 {
- 179 3 if (NewState != DISABLE)
- 180 3 {
- 181 4 /* set timer0 clock source from t0 pin(falling edge) */
- 182 4 MODIFY_REG(TMOD, TMOD_TIM0_CT_Msk, 1 << TMOD_TIM0_CT_Pos);
- 183 4 }
- 184 3 else
- 185 3 {
- 186 4 /* set timer0 basetime enable */
- 187 4 MODIFY_REG(TMOD, TMOD_TIM0_CT_Msk, 0 << TMOD_TIM0_CT_Pos);
- 188 4 }
- 189 3 break;
- 190 3 }
- 191 2 case TIMER1:
- 192 2 {
- 193 3 if (NewState != DISABLE)
- 194 3 {
- 195 4 /* set timer1 clock source from t1 pin(falling edge) */
- 196 4 MODIFY_REG(TMOD, TMOD_TIM1_CT_Msk, 1 << TMOD_TIM1_CT_Pos);
- 197 4 }
- 198 3 else
- 199 3 {
- 200 4 /* set timer1 basetime enable */
- 201 4 MODIFY_REG(TMOD, TMOD_TIM1_CT_Msk, 0 << TMOD_TIM1_CT_Pos);
- 202 4 }
- 203 3 break;
- 204 3 }
- 205 2 case TIMER2:
- 206 2 {
- 207 3 /* set timer2 disable */
- 208 3 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_STOP << T2CON_T2I_Pos);
- 209 3
- 210 3 if (NewState != DISABLE)
- 211 3 {
- 212 4 /* set timer2 clock source from t2 pin(falling edge) */
- 213 4 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_T2PIN << T2CON_T2I_Pos);
- 214 4 }
- 215 3 else
- 216 3 {
- 217 4 /* set timer2 clock source from xtal or rch */
- 218 4 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_INTERNAL << T2CON_T2I_Pos);
- 219 4 }
- 220 3 break;
- 221 3 }
- 222 2 default:
- 223 2 break;
- 224 2 }
- 225 1 }
- 226
- 227 /**
- 228 * @brief Enables or disables TIMERx peripheral clock gate.
- 229 * @param TIMERx: where x can be 0 to 2 to select the TIM peripheral.
- 230 * @param TIM_Mode: specifies the workmode of timer.
- 231 * This parameter can be a value of @ref TIM_ModeTypeDef
- 232 * @param NewState: new state of the TIMERx peripheral clock gate.
- 233 * This parameter can be: ENABLE or DISABLE.
- 234 * @retval None
- 235 */
- 236 void TIM_GateConfig(TIM_IdTypeDef TIMERx, FunctionalState NewState)
- 237 {
- 238 1 /* Check the parameters */
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 5
- 239 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 240 1 assert_param(IS_FUNCTIONAL_STATE(NewState));
- 241 1
- 242 1 switch (TIMERx)
- 243 1 {
- 244 2 case TIMER0:
- 245 2 {
- 246 3 if (NewState != DISABLE)
- 247 3 {
- 248 4 /* set timer0 external clock count gate function enable */
- 249 4 MODIFY_REG(TMOD, TMOD_TIM0_GATE_Msk, 1 << TMOD_TIM0_GATE_Pos);
- 250 4 }
- 251 3 else
- 252 3 {
- 253 4 /* set timer0 basetime enable */
- 254 4 MODIFY_REG(TMOD, TMOD_TIM0_GATE_Msk, 0 << TMOD_TIM0_GATE_Pos);
- 255 4 }
- 256 3 break;
- 257 3 }
- 258 2 case TIMER1:
- 259 2 {
- 260 3 if (NewState != DISABLE)
- 261 3 {
- 262 4 /* set timer1 external clock gate function enable */
- 263 4 MODIFY_REG(TMOD, TMOD_TIM1_GATE_Msk, 1 << TMOD_TIM1_GATE_Pos);
- 264 4 }
- 265 3 else
- 266 3 {
- 267 4 /* set timer1 basetime enable */
- 268 4 MODIFY_REG(TMOD, TMOD_TIM1_GATE_Msk, 0 << TMOD_TIM1_GATE_Pos);
- 269 4 }
- 270 3 break;
- 271 3 }
- 272 2 case TIMER2:
- 273 2 {
- 274 3 /* set timer2 disable */
- 275 3 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_STOP << T2CON_T2I_Pos);
- 276 3
- 277 3 if (NewState != DISABLE)
- 278 3 {
- 279 4 /* set timer1 internal clock gate function enable */
- 280 4 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_GATE_CTRL << T2CON_T2I_Pos);
- 281 4 }
- 282 3 else
- 283 3 {
- 284 4 /* set timer2 clock source from xtal or rch */
- 285 4 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_INTERNAL << T2CON_T2I_Pos);
- 286 4 }
- 287 3 break;
- 288 3 }
- 289 2 default:
- 290 2 break;
- 291 2 }
- 292 1 }
- 293
- 294 /**
- 295 * @brief Initializes the TIMER2 compare peripheral
- 296 * according to the specified parameters.
- 297 * @param TIMERx: TIMER2(only support TIMER2).
- 298 * @param channel: specifies the compare channel of TIMER2.
- 299 * This parameter can be a value of @ref TIM_ChTypeDef
- 300 * @param CmpMode: Specifies the compare mode of TIMER2.
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 6
- 301 * This parameter can be a value of @ref TIM_CmpModeTypeDef
- 302 * @param CmpVal: specifies the initial value of compare register.
- 303 * @retval None
- 304 */
- 305 void TIM_CmpInit(TIM_IdTypeDef TIMERx, TIM_ChTypeDef Channel, TIM_CmpModeTypeDef CmpMode, u16 CmpVal)
- 306 {
- 307 1 /* Check the parameters */
- 308 1 assert_param(TIMER2 == TIMERx);
- 309 1
- 310 1 if (TIMER2 != TIMERx)
- 311 1 {
- 312 2 return;
- 313 2 }
- 314 1
- 315 1 /* set timer2 reload mode disable */
- 316 1 // MODIFY_REG(T2CON, T2CON_T2R_Msk, TIM2_RELOAD_DISABLE<<T2CON_T2R_Pos);
- 317 1
- 318 1 /* disable timer2 compare&capture function */
- 319 1 MODIFY_REG(CCEN, CCEN_COCA0_Msk << (Channel << 1), TIM_CmpCapDisable << CCEN_COCA0_Pos);
- 320 1
- 321 1 /* set timer2 compare/capture register */
- 322 1 if (Channel == TIM_Channel0)
- 323 1 {
- 324 2 TIM_SET_VAL(CRCH, CRCL, CmpVal);
- 325 2 }
- 326 1 else if (Channel == TIM_Channel1)
- 327 1 {
- 328 2 TIM_SET_VAL(CCH1, CCL1, CmpVal);
- 329 2 }
- 330 1 else if (Channel == TIM_Channel2)
- 331 1 {
- 332 2 TIM_SET_VAL(CCH2, CCL2, CmpVal);
- 333 2 }
- 334 1 else if (Channel == TIM_Channel3)
- 335 1 {
- 336 2 TIM_SET_VAL(CCH3, CCL3, CmpVal);
- 337 2 }
- 338 1
- 339 1 /* set timer2 compare mode */
- 340 1 MODIFY_REG(T2CON, T2CON_T2CM_Msk, CmpMode << T2CON_T2CM_Pos);
- 341 1
- 342 1 /* enable timer2 compare function */
- 343 1 MODIFY_REG(CCEN, CCEN_COCA0_Msk << (Channel << 1), TIM_CmpEnable << (Channel << 1));
- 344 1 }
- 345
- 346 /**
- 347 * @brief Initializes the TIMER2 capture peripheral
- 348 * according to the specified parameters.
- 349 * @param TIMERx: TIMER2(only support TIMER2).
- 350 * @param channel: specifies the compare channel of TIMER2.
- 351 * This parameter can be a value of @ref TIM_ChTypeDef
- 352 * @param CmpMode: Specifies the capture mode of TIMER2.
- 353 * This parameter can be a value of @ref TIM_CapModeTypeDef
- 354 * @param CmpVal: specifies the initial value of compare register.
- 355 * @retval None
- 356 */
- 357 void TIM_CapInit(TIM_IdTypeDef TIMERx, TIM_ChTypeDef Channel, TIM_CapModeTypeDef CapMode, TIM_CapPolTypeDe
- -f Polarity,
- 358 u16 CmpVal)
- 359 {
- 360 1 /* Check the parameters */
- 361 1 assert_param(TIMER2 == TIMERx);
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 7
- 362 1
- 363 1 if (TIMER2 != TIMERx)
- 364 1 {
- 365 2 return;
- 366 2 }
- 367 1
- 368 1 /* disable timer2 compare&capture function */
- 369 1 MODIFY_REG(CCEN, CCEN_COCA0_Msk << (Channel << 1), TIM_CmpCapDisable << CCEN_COCA0_Pos);
- 370 1
- 371 1 /* set timer2 compare/capture register */
- 372 1 if (Channel == TIM_Channel0)
- 373 1 {
- 374 2 TIM_SET_VAL(CRCH, CRCH, CmpVal);
- 375 2 }
- 376 1 else if (Channel == TIM_Channel1)
- 377 1 {
- 378 2 TIM_SET_VAL(CCH1, CCL1, CmpVal);
- 379 2 }
- 380 1 else if (Channel == TIM_Channel2)
- 381 1 {
- 382 2 TIM_SET_VAL(CCH2, CCL2, CmpVal);
- 383 2 }
- 384 1 else if (Channel == TIM_Channel3)
- 385 1 {
- 386 2 TIM_SET_VAL(CCH3, CCL3, CmpVal);
- 387 2 }
- 388 1
- 389 1 if (TIM_CapMode0 == CapMode)
- 390 1 {
- 391 2 /* set timer2 capture mode0 */
- 392 2 MODIFY_REG(CCEN, CCEN_COCA0_Msk << (Channel << 1), TIM_CapCCxPin << (Channel << 1));
- 393 2
- 394 2 /* set timer2 input polarity */
- 395 2 MODIFY_REG(TCAPCON, TCAPCON_CC0_Msk << (Channel << 1), Polarity << (Channel << 1));
- 396 2 }
- 397 1 else if (TIM_CapMode1 == CapMode)
- 398 1 {
- 399 2 /* set timer2 capture mode0 */
- 400 2 MODIFY_REG(CCEN, CCEN_COCA0_Msk << (Channel << 1), TIM_CapSoftTrigger << (Channel << 1));
- 401 2 }
- 402 1 }
- 403
- 404 /**
- 405 * @brief Enables or disables the specified TIM peripheral.
- 406 * @param TIMERx: where x can be 0 to 2 to select the TIMERx peripheral.
- 407 * @param NewState: new state of the TIMERx peripheral.
- 408 * This parameter can be: ENABLE or DISABLE.
- 409 * @retval None
- 410 */
- 411 void TIM_Cmd(TIM_IdTypeDef TIMERx, FunctionalState NewState)
- 412 {
- 413 1 /* Check the parameters */
- 414 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 415 1 assert_param(IS_FUNCTIONAL_STATE(NewState));
- 416 1
- 417 1 switch (TIMERx)
- 418 1 {
- 419 2 case TIMER0:
- 420 2 {
- 421 3 if (NewState != DISABLE)
- 422 3 {
- 423 4 TR0 = 1; /* set timer0 enable */
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 8
- 424 4 }
- 425 3 else
- 426 3 {
- 427 4 TR0 = 0; /* set timer0 disable */
- 428 4 }
- 429 3 break;
- 430 3 }
- 431 2 case TIMER1:
- 432 2 {
- 433 3 if (NewState != DISABLE)
- 434 3 {
- 435 4 TR1 = 1; /* set timer1 enable */
- 436 4 }
- 437 3 else
- 438 3 {
- 439 4 TR1 = 0; /* set timer1 disable */
- 440 4 }
- 441 3 break;
- 442 3 }
- 443 2 case TIMER2:
- 444 2 {
- 445 3 if (NewState != DISABLE)
- 446 3 {
- 447 4 /* set Timer2 enable */
- 448 4 if ((T2CON & T2CON_T2I_Msk) == TIM2_CLK_STOP)
- 449 4 {
- 450 5 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_INTERNAL << T2CON_T2I_Pos);
- 451 5 }
- 452 4 }
- 453 3 else
- 454 3 {
- 455 4 /* set timer2 disable */
- 456 4 MODIFY_REG(T2CON, T2CON_T2I_Msk, TIM2_CLK_STOP << T2CON_T2I_Pos);
- 457 4 }
- 458 3 break;
- 459 3 }
- 460 2 default:
- 461 2 break;
- 462 2 }
- 463 1 }
- 464
- 465 /**
- 466 * @brief This function enable TIMERx interrupt
- 467 * @param TIMERx: where x can be 0 to 2 to select the TIMERx peripheral.
- 468 * @retval None
- 469 */
- 470 void TIM_EnableIRQ(TIM_IdTypeDef TIMERx)
- 471 {
- 472 1 /* Check the parameters */
- 473 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 474 1
- 475 1 switch (TIMERx)
- 476 1 {
- 477 2 case TIMER0:
- 478 2 {
- 479 3 ET0 = 1;
- 480 3 break;
- 481 3 }
- 482 2 case TIMER1:
- 483 2 {
- 484 3 ET1 = 1;
- 485 3 break;
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 9
- 486 3 }
- 487 2 case TIMER2:
- 488 2 {
- 489 3 ET2 = 1;
- 490 3 break;
- 491 3 }
- 492 2 default:
- 493 2 break;
- 494 2 }
- 495 1 }
- 496
- 497 /**
- 498 * @brief This function disable TIMERx interrupt
- 499 * @param TIMERx: where x can be 0 to 2 to select the TIMERx peripheral.
- 500 * @retval None
- 501 */
- 502 void TIM_DisableIRQ(TIM_IdTypeDef TIMERx)
- 503 {
- 504 1 /* Check the parameters */
- 505 1 assert_param(IS_TIM_ALL_PERIPH(TIMERx));
- 506 1
- 507 1 switch (TIMERx)
- 508 1 {
- 509 2 case TIMER0:
- 510 2 {
- 511 3 ET0 = 0;
- 512 3 break;
- 513 3 }
- 514 2 case TIMER1:
- 515 2 {
- 516 3 ET1 = 0;
- 517 3 break;
- 518 3 }
- 519 2 case TIMER2:
- 520 2 {
- 521 3 ET2 = 0;
- 522 3 break;
- 523 3 }
- 524 2 default:
- 525 2 break;
- 526 2 }
- 527 1 }
- 528 /**
- 529 * @}
- 530 */
- 531
- 532 /**
- 533 * @}
- 534 */
- 535
- 536 /**
- 537 * @}
- 538 */
- MODULE INFORMATION: STATIC OVERLAYABLE
- CODE SIZE = 854 ----
- CONSTANT SIZE = ---- ----
- XDATA SIZE = ---- ----
- PDATA SIZE = ---- ----
- DATA SIZE = ---- 16
- IDATA SIZE = ---- ----
- C51 COMPILER V9.60.7.0 TIMER 11/21/2025 17:21:11 PAGE 10
- BIT SIZE = ---- ----
- EDATA SIZE = ---- ----
- HDATA SIZE = ---- ----
- XDATA CONST SIZE = ---- ----
- FAR CONST SIZE = ---- ----
- END OF MODULE INFORMATION.
- C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
|