Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of target-mcu-k64f by
fsl_sim_hal_K64F12.c
00001 /* 00002 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, 00006 * are permitted provided that the following conditions are met: 00007 * 00008 * o Redistributions of source code must retain the above copyright notice, this list 00009 * of conditions and the following disclaimer. 00010 * 00011 * o Redistributions in binary form must reproduce the above copyright notice, this 00012 * list of conditions and the following disclaimer in the documentation and/or 00013 * other materials provided with the distribution. 00014 * 00015 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its 00016 * contributors may be used to endorse or promote products derived from this 00017 * software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00022 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 00023 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00026 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00028 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 */ 00030 00031 #include <stdint.h> 00032 #include <stdlib.h> 00033 #include <stdbool.h> 00034 #include "fsl_device_registers.h" 00035 #include "fsl_sim_hal_K64F12.h " 00036 #include "fsl_sim_hal.h" 00037 00038 /******************************************************************************* 00039 * Definitions 00040 ******************************************************************************/ 00041 00042 /*! @brief CLOCK name config table for K64*/ 00043 const clock_name_config_t kClockNameConfigTable [] = { 00044 {false, kSystemClock, kClockDividerOutdiv1}, 00045 {false, kSystemClock, kClockDividerOutdiv1}, 00046 {false, kSystemClock, kClockDividerOutdiv1}, 00047 {false, kSystemClock, kClockDividerOutdiv2}, 00048 {false, kSystemClock, kClockDividerOutdiv3}, 00049 {false, kSystemClock, kClockDividerOutdiv4} 00050 }; 00051 00052 /******************************************************************************* 00053 * APIs 00054 ******************************************************************************/ 00055 00056 /*FUNCTION********************************************************************** 00057 * 00058 * Function Name : SIM_HAL_EnableDmaClock 00059 * Description : Enable the clock for DMA module 00060 * This function enables the clock for DMA moudle 00061 * 00062 *END**************************************************************************/ 00063 void SIM_HAL_EnableDmaClock(uint32_t baseAddr, uint32_t instance) 00064 { 00065 BW_SIM_SCGC7_DMA(baseAddr, 1); 00066 } 00067 00068 /*FUNCTION********************************************************************** 00069 * 00070 * Function Name : SIM_HAL_DisableDmaClock 00071 * Description : Disable the clock for DMA module 00072 * This function disables the clock for DMA moudle 00073 * 00074 *END**************************************************************************/ 00075 void SIM_HAL_DisableDmaClock(uint32_t baseAddr, uint32_t instance) 00076 { 00077 BW_SIM_SCGC7_DMA(baseAddr, 0); 00078 } 00079 00080 /*FUNCTION********************************************************************** 00081 * 00082 * Function Name : SIM_HAL_GetDmaGateCmd 00083 * Description : Get the the clock gate state for DMA module 00084 * This function will get the clock gate state for DMA moudle 00085 * 00086 *END**************************************************************************/ 00087 bool SIM_HAL_GetDmaGateCmd(uint32_t baseAddr, uint32_t instance) 00088 { 00089 return BR_SIM_SCGC7_DMA(baseAddr); 00090 } 00091 00092 /*FUNCTION********************************************************************** 00093 * 00094 * Function Name : SIM_HAL_EnableDmamuxClock 00095 * Description : Enable the clock for DMAMUX module 00096 * This function enables the clock for DMAMUX moudle 00097 * 00098 *END**************************************************************************/ 00099 void SIM_HAL_EnableDmamuxClock(uint32_t baseAddr, uint32_t instance) 00100 { 00101 BW_SIM_SCGC6_DMAMUX(baseAddr, 1); 00102 } 00103 00104 /*FUNCTION********************************************************************** 00105 * 00106 * Function Name : SIM_HAL_DisableDmamuxClock 00107 * Description : Disable the clock for DMAMUX module 00108 * This function disables the clock for DMAMUX moudle 00109 * 00110 *END**************************************************************************/ 00111 void SIM_HAL_DisableDmamuxClock(uint32_t baseAddr, uint32_t instance) 00112 { 00113 BW_SIM_SCGC6_DMAMUX(baseAddr, 0); 00114 } 00115 00116 /*FUNCTION********************************************************************** 00117 * 00118 * Function Name : SIM_HAL_GetDmamuxGateCmd 00119 * Description : Get the the clock gate state for DMAMUX module 00120 * This function will get the clock gate state for DMAMUX moudle 00121 * 00122 *END**************************************************************************/ 00123 bool SIM_HAL_GetDmamuxGateCmd(uint32_t baseAddr, uint32_t instance) 00124 { 00125 return BR_SIM_SCGC6_DMAMUX(baseAddr); 00126 } 00127 00128 /*FUNCTION********************************************************************** 00129 * 00130 * Function Name : SIM_HAL_EnablePortClock 00131 * Description : Enable the clock for PORT module 00132 * This function enables the clock for PORT moudle 00133 * 00134 *END**************************************************************************/ 00135 void SIM_HAL_EnablePortClock(uint32_t baseAddr, uint32_t instance) 00136 { 00137 switch (instance) 00138 { 00139 case 0: 00140 BW_SIM_SCGC5_PORTA(baseAddr, 1); 00141 break; 00142 case 1: 00143 BW_SIM_SCGC5_PORTB(baseAddr, 1); 00144 break; 00145 case 2: 00146 BW_SIM_SCGC5_PORTC(baseAddr, 1); 00147 break; 00148 case 3: 00149 BW_SIM_SCGC5_PORTD(baseAddr, 1); 00150 break; 00151 case 4: 00152 BW_SIM_SCGC5_PORTE(baseAddr, 1); 00153 break; 00154 default: 00155 break; 00156 } 00157 } 00158 00159 /*FUNCTION********************************************************************** 00160 * 00161 * Function Name : SIM_HAL_DisablePortClock 00162 * Description : Disable the clock for PORT module 00163 * This function disables the clock for PORT moudle 00164 * 00165 *END**************************************************************************/ 00166 void SIM_HAL_DisablePortClock(uint32_t baseAddr, uint32_t instance) 00167 { 00168 switch (instance) 00169 { 00170 case 0: 00171 BW_SIM_SCGC5_PORTA(baseAddr, 0); 00172 break; 00173 case 1: 00174 BW_SIM_SCGC5_PORTB(baseAddr, 0); 00175 break; 00176 case 2: 00177 BW_SIM_SCGC5_PORTC(baseAddr, 0); 00178 break; 00179 case 3: 00180 BW_SIM_SCGC5_PORTD(baseAddr, 0); 00181 break; 00182 case 4: 00183 BW_SIM_SCGC5_PORTE(baseAddr, 0); 00184 break; 00185 default: 00186 break; 00187 } 00188 } 00189 00190 /*FUNCTION********************************************************************** 00191 * 00192 * Function Name : SIM_HAL_GetPortGateCmd 00193 * Description : Get the the clock gate state for PORT module 00194 * This function will get the clock gate state for PORT moudle. 00195 * 00196 *END**************************************************************************/ 00197 bool SIM_HAL_GetPortGateCmd(uint32_t baseAddr, uint32_t instance) 00198 { 00199 bool retValue = false; 00200 00201 switch (instance) 00202 { 00203 case 0: 00204 retValue = BR_SIM_SCGC5_PORTA(baseAddr); 00205 break; 00206 case 1: 00207 retValue = BR_SIM_SCGC5_PORTB(baseAddr); 00208 break; 00209 case 2: 00210 retValue = BR_SIM_SCGC5_PORTC(baseAddr); 00211 break; 00212 case 3: 00213 retValue = BR_SIM_SCGC5_PORTD(baseAddr); 00214 break; 00215 case 4: 00216 retValue = BR_SIM_SCGC5_PORTE(baseAddr); 00217 break; 00218 default: 00219 retValue = false; 00220 break; 00221 } 00222 00223 return retValue; 00224 } 00225 00226 /*FUNCTION********************************************************************** 00227 * 00228 * Function Name : SIM_HAL_EnableMpuClock 00229 * Description : Enable the clock for MPU module 00230 * This function enables the clock for MPU moudle. 00231 * 00232 *END**************************************************************************/ 00233 void SIM_HAL_EnableMpuClock(uint32_t baseAddr, uint32_t instance) 00234 { 00235 BW_SIM_SCGC7_MPU(baseAddr, 1); 00236 } 00237 00238 /*FUNCTION********************************************************************** 00239 * 00240 * Function Name : SIM_HAL_DisableMpuClock 00241 * Description : Disable the clock for MPU module. 00242 * This function disables the clock for MPU moudle. 00243 * 00244 *END**************************************************************************/ 00245 void SIM_HAL_DisableMpuClock(uint32_t baseAddr, uint32_t instance) 00246 { 00247 BW_SIM_SCGC7_MPU(baseAddr, 0); 00248 } 00249 00250 /*FUNCTION********************************************************************** 00251 * 00252 * Function Name : SIM_HAL_GetMpuGateCmd 00253 * Description : Get the the clock gate state for MPU module 00254 * This function will get the clock gate state for MPU moudl. 00255 * 00256 *END**************************************************************************/ 00257 bool SIM_HAL_GetMpuGateCmd(uint32_t baseAddr, uint32_t instance) 00258 { 00259 return BR_SIM_SCGC7_MPU(baseAddr); 00260 } 00261 00262 /*FUNCTION********************************************************************** 00263 * 00264 * Function Name : SIM_HAL_EnableEwmClock 00265 * Description : Enable the clock for EWM module 00266 * This function enables the clock for EWM moudle. 00267 * 00268 *END**************************************************************************/ 00269 void SIM_HAL_EnableEwmClock(uint32_t baseAddr, uint32_t instance) 00270 { 00271 BW_SIM_SCGC4_EWM(baseAddr, 1); 00272 } 00273 00274 /*FUNCTION********************************************************************** 00275 * 00276 * Function Name : SIM_HAL_DisableEwmClock 00277 * Description : Disable the clock for EWM modul 00278 * This function disables the clock for EWM moudle. 00279 * 00280 *END**************************************************************************/ 00281 void SIM_HAL_DisableEwmClock(uint32_t baseAddr, uint32_t instance) 00282 { 00283 BW_SIM_SCGC4_EWM(baseAddr, 0); 00284 } 00285 00286 /*FUNCTION********************************************************************** 00287 * 00288 * Function Name : SIM_HAL_GetEwmGateCmd 00289 * Description : Get the the clock gate state for EWM module 00290 * This function will get the clock gate state for EWM moudle. 00291 * 00292 *END**************************************************************************/ 00293 bool SIM_HAL_GetEwmGateCmd(uint32_t baseAddr, uint32_t instance) 00294 { 00295 return BR_SIM_SCGC4_EWM(baseAddr); 00296 } 00297 00298 /*FUNCTION********************************************************************** 00299 * 00300 * Function Name : SIM_HAL_EnableFlexbusClock 00301 * Description : Enable the clock for FLEXBUS module 00302 * This function enables the clock for FLEXBUS moudle. 00303 * 00304 *END**************************************************************************/ 00305 void SIM_HAL_EnableFlexbusClock(uint32_t baseAddr, uint32_t instance) 00306 { 00307 BW_SIM_SCGC7_FLEXBUS(baseAddr, 1); 00308 } 00309 00310 /*FUNCTION********************************************************************** 00311 * 00312 * Function Name : SIM_HAL_DisableFlexbusClock 00313 * Description : Disable the clock for FLEXBUS module 00314 * This function disables the clock for FLEXBUS moudle. 00315 * 00316 *END**************************************************************************/ 00317 void SIM_HAL_DisableFlexbusClock(uint32_t baseAddr, uint32_t instance) 00318 { 00319 BW_SIM_SCGC7_FLEXBUS(baseAddr, 0); 00320 } 00321 00322 /*FUNCTION********************************************************************** 00323 * 00324 * Function Name : SIM_HAL_GetFlexbusGateCmd 00325 * Description : Get the the clock gate state for FLEXBUS module 00326 * This function will get the clock gate state for FLEXBUS moudle. 00327 * 00328 *END**************************************************************************/ 00329 bool SIM_HAL_GetFlexbusGateCmd(uint32_t baseAddr, uint32_t instance) 00330 { 00331 return BR_SIM_SCGC7_FLEXBUS(baseAddr); 00332 } 00333 00334 /*FUNCTION********************************************************************** 00335 * 00336 * Function Name : SIM_HAL_EnableFtfClock 00337 * Description : Enable the clock for FTF module 00338 * This function enables the clock for FTF moudle. 00339 * 00340 *END**************************************************************************/ 00341 void SIM_HAL_EnableFtfClock(uint32_t baseAddr, uint32_t instance) 00342 { 00343 BW_SIM_SCGC6_FTF(baseAddr, 1); 00344 } 00345 00346 /*FUNCTION********************************************************************** 00347 * 00348 * Function Name : SIM_HAL_DisableFtfClock 00349 * Description : Disable the clock for FTF module 00350 * This function disables the clock for FTF moudle. 00351 * 00352 *END**************************************************************************/ 00353 void SIM_HAL_DisableFtfClock(uint32_t baseAddr, uint32_t instance) 00354 { 00355 BW_SIM_SCGC6_FTF(baseAddr, 0); 00356 } 00357 00358 /*FUNCTION********************************************************************** 00359 * 00360 * Function Name : SIM_HAL_GetFtfGateCmd 00361 * Description : Get the the clock gate state for FTF module 00362 * This function will get the clock gate state for FTF moudle. 00363 * 00364 *END**************************************************************************/ 00365 bool SIM_HAL_GetFtfGateCmd(uint32_t baseAddr, uint32_t instance) 00366 { 00367 return BR_SIM_SCGC6_FTF(baseAddr); 00368 } 00369 00370 /*FUNCTION********************************************************************** 00371 * 00372 * Function Name : SIM_HAL_EnableCrcClock 00373 * Description : Enable the clock for CRC module 00374 * This function enables the clock for CRC moudle. 00375 * 00376 *END**************************************************************************/ 00377 void SIM_HAL_EnableCrcClock(uint32_t baseAddr, uint32_t instance) 00378 { 00379 BW_SIM_SCGC6_CRC(baseAddr, 1); 00380 } 00381 00382 /*FUNCTION********************************************************************** 00383 * 00384 * Function Name : SIM_HAL_DisableCrcClock 00385 * Description : Disable the clock for CRC module 00386 * This function disables the clock for CRC moudle. 00387 * 00388 *END**************************************************************************/ 00389 void SIM_HAL_DisableCrcClock(uint32_t baseAddr, uint32_t instance) 00390 { 00391 BW_SIM_SCGC6_CRC(baseAddr, 0); 00392 } 00393 00394 /*FUNCTION********************************************************************** 00395 * 00396 * Function Name : SIM_HAL_GetCrcGateCmd 00397 * Description : Get the the clock gate state for CRC module 00398 * This function will get the clock gate state for CRC moudle. 00399 * 00400 *END**************************************************************************/ 00401 bool SIM_HAL_GetCrcGateCmd(uint32_t baseAddr, uint32_t instance) 00402 { 00403 return BR_SIM_SCGC6_CRC(baseAddr); 00404 } 00405 00406 /*FUNCTION********************************************************************** 00407 * 00408 * Function Name : SIM_HAL_EnableRngaClock 00409 * Description : Enable the clock for RNGA module 00410 * This function enables the clock for RNGA moudle. 00411 * 00412 *END**************************************************************************/ 00413 void SIM_HAL_EnableRngaClock(uint32_t baseAddr, uint32_t instance) 00414 { 00415 BW_SIM_SCGC6_RNGA(baseAddr, 1); 00416 } 00417 00418 /*FUNCTION********************************************************************** 00419 * 00420 * Function Name : SIM_HAL_DisableRngaClock 00421 * Description : Disable the clock for RNGA module 00422 * This function disables the clock for RNGA moudle. 00423 * 00424 *END**************************************************************************/ 00425 void SIM_HAL_DisableRngaClock(uint32_t baseAddr, uint32_t instance) 00426 { 00427 BW_SIM_SCGC6_RNGA(baseAddr, 0); 00428 } 00429 00430 /*FUNCTION********************************************************************** 00431 * 00432 * Function Name : SIM_HAL_GetRngaGateCmd 00433 * Description : Get the the clock gate state for RNGA module 00434 * This function will get the clock gate state for RNGA moudle. 00435 * 00436 *END**************************************************************************/ 00437 bool SIM_HAL_GetRngaGateCmd(uint32_t baseAddr, uint32_t instance) 00438 { 00439 return BR_SIM_SCGC6_RNGA(baseAddr); 00440 } 00441 00442 /*FUNCTION********************************************************************** 00443 * 00444 * Function Name : SIM_HAL_EnableAdcClock 00445 * Description : Enable the clock for ADC module 00446 * This function enables the clock for ADC moudle 00447 * 00448 *END**************************************************************************/ 00449 void SIM_HAL_EnableAdcClock(uint32_t baseAddr, uint32_t instance) 00450 { 00451 switch (instance) 00452 { 00453 case 0: 00454 BW_SIM_SCGC6_ADC0(baseAddr, 1); 00455 break; 00456 case 1: 00457 BW_SIM_SCGC3_ADC1(baseAddr, 1); 00458 break; 00459 default: 00460 break; 00461 } 00462 } 00463 00464 /*FUNCTION********************************************************************** 00465 * 00466 * Function Name : SIM_HAL_DisableAdcClock 00467 * Description : Disable the clock for ADC module 00468 * This function disables the clock for ADC moudle 00469 * 00470 *END**************************************************************************/ 00471 void SIM_HAL_DisableAdcClock(uint32_t baseAddr, uint32_t instance) 00472 { 00473 switch (instance) 00474 { 00475 case 0: 00476 BW_SIM_SCGC6_ADC0(baseAddr, 0); 00477 break; 00478 case 1: 00479 BW_SIM_SCGC3_ADC1(baseAddr, 0); 00480 break; 00481 default: 00482 break; 00483 } 00484 } 00485 00486 /*FUNCTION********************************************************************** 00487 * 00488 * Function Name : SIM_HAL_GetAdcGateCmd 00489 * Description : Get the the clock gate state for ADC module 00490 * This function will get the clock gate state for ADC moudle. 00491 * 00492 *END**************************************************************************/ 00493 bool SIM_HAL_GetAdcGateCmd(uint32_t baseAddr, uint32_t instance) 00494 { 00495 bool retValue = false; 00496 00497 switch (instance) 00498 { 00499 case 0: 00500 retValue = BR_SIM_SCGC6_ADC0(baseAddr); 00501 break; 00502 case 1: 00503 retValue = BR_SIM_SCGC3_ADC1(baseAddr); 00504 break; 00505 default: 00506 retValue = false; 00507 break; 00508 } 00509 00510 return retValue; 00511 } 00512 00513 /*FUNCTION********************************************************************** 00514 * 00515 * Function Name : SIM_HAL_EnableCmpClock 00516 * Description : Enable the clock for CMP module 00517 * This function enables the clock for CMP moudle 00518 * 00519 *END**************************************************************************/ 00520 void SIM_HAL_EnableCmpClock(uint32_t baseAddr, uint32_t instance) 00521 { 00522 BW_SIM_SCGC4_CMP(baseAddr, 1); 00523 } 00524 00525 /*FUNCTION********************************************************************** 00526 * 00527 * Function Name : SIM_HAL_DisableCmpClock 00528 * Description : Disable the clock for CMP module 00529 * This function disables the clock for CMP moudle 00530 * 00531 *END**************************************************************************/ 00532 void SIM_HAL_DisableCmpClock(uint32_t baseAddr, uint32_t instance) 00533 { 00534 BW_SIM_SCGC4_CMP(baseAddr, 0); 00535 } 00536 00537 /*FUNCTION********************************************************************** 00538 * 00539 * Function Name : SIM_HAL_GetCmpGateCmd 00540 * Description : Get the the clock gate state for CMP module 00541 * This function will get the clock gate state for CMP moudle. 00542 * 00543 *END**************************************************************************/ 00544 bool SIM_HAL_GetCmpGateCmd(uint32_t baseAddr, uint32_t instance) 00545 { 00546 return BR_SIM_SCGC4_CMP(baseAddr); 00547 } 00548 00549 /*FUNCTION********************************************************************** 00550 * 00551 * Function Name : SIM_HAL_EnableDacClock 00552 * Description : Enable the clock for DAC module 00553 * This function enables the clock for DAC moudle 00554 * 00555 *END**************************************************************************/ 00556 void SIM_HAL_EnableDacClock(uint32_t baseAddr, uint32_t instance) 00557 { 00558 switch (instance) 00559 { 00560 case 0: 00561 BW_SIM_SCGC2_DAC0(baseAddr, 1); 00562 break; 00563 case 1: 00564 BW_SIM_SCGC2_DAC1(baseAddr, 1); 00565 break; 00566 default: 00567 break; 00568 } 00569 } 00570 00571 /*FUNCTION********************************************************************** 00572 * 00573 * Function Name : SIM_HAL_DisableDacClock 00574 * Description : Disable the clock for DAC module 00575 * This function disables the clock for DAC moudle 00576 * 00577 *END**************************************************************************/ 00578 void SIM_HAL_DisableDacClock(uint32_t baseAddr, uint32_t instance) 00579 { 00580 switch (instance) 00581 { 00582 case 0: 00583 BW_SIM_SCGC2_DAC0(baseAddr, 0); 00584 break; 00585 case 1: 00586 BW_SIM_SCGC2_DAC1(baseAddr, 0); 00587 break; 00588 default: 00589 break; 00590 } 00591 } 00592 00593 /*FUNCTION********************************************************************** 00594 * 00595 * Function Name : SIM_HAL_GetDacGateCmd 00596 * Description : Get the the clock gate state for DAC module 00597 * This function will get the clock gate state for DAC moudle. 00598 * 00599 *END**************************************************************************/ 00600 bool SIM_HAL_GetDacGateCmd(uint32_t baseAddr, uint32_t instance) 00601 { 00602 bool retValue = false; 00603 00604 switch (instance) 00605 { 00606 case 0: 00607 retValue = BR_SIM_SCGC2_DAC0(baseAddr); 00608 break; 00609 case 1: 00610 retValue = BR_SIM_SCGC2_DAC1(baseAddr); 00611 break; 00612 default: 00613 retValue = false; 00614 break; 00615 } 00616 00617 return retValue; 00618 } 00619 00620 /*FUNCTION********************************************************************** 00621 * 00622 * Function Name : SIM_HAL_EnableVrefClock 00623 * Description : Enable the clock for VREF module 00624 * This function enables the clock for VREF moudle 00625 * 00626 *END**************************************************************************/ 00627 void SIM_HAL_EnableVrefClock(uint32_t baseAddr, uint32_t instance) 00628 { 00629 BW_SIM_SCGC4_VREF(baseAddr, 1); 00630 } 00631 00632 /*FUNCTION********************************************************************** 00633 * 00634 * Function Name : SIM_HAL_DisableVrefClock 00635 * Description : Disable the clock for VREF module 00636 * This function disables the clock for VREF moudle 00637 * 00638 *END**************************************************************************/ 00639 void SIM_HAL_DisableVrefClock(uint32_t baseAddr, uint32_t instance) 00640 { 00641 BW_SIM_SCGC4_VREF(baseAddr, 0); 00642 } 00643 00644 /*FUNCTION********************************************************************** 00645 * 00646 * Function Name : SIM_HAL_GetVrefGateCmd 00647 * Description : Get the the clock gate state for VREF module 00648 * This function will get the clock gate state for VREF moudle. 00649 * 00650 *END**************************************************************************/ 00651 bool SIM_HAL_GetVrefGateCmd(uint32_t baseAddr, uint32_t instance) 00652 { 00653 return BR_SIM_SCGC4_VREF(baseAddr); 00654 } 00655 00656 /*FUNCTION********************************************************************** 00657 * 00658 * Function Name : SIM_HAL_EnableSaiClock 00659 * Description : Enable the clock for SAI module 00660 * This function enables the clock for SAI moudle 00661 * 00662 *END**************************************************************************/ 00663 void SIM_HAL_EnableSaiClock(uint32_t baseAddr, uint32_t instance) 00664 { 00665 BW_SIM_SCGC6_I2S(baseAddr, 1); 00666 } 00667 00668 /*FUNCTION********************************************************************** 00669 * 00670 * Function Name : SIM_HAL_DisableSaiClock 00671 * Description : Disable the clock for SAI module 00672 * This function disables the clock for SAI moudle 00673 * 00674 *END**************************************************************************/ 00675 void SIM_HAL_DisableSaiClock(uint32_t baseAddr, uint32_t instance) 00676 { 00677 BW_SIM_SCGC6_I2S(baseAddr, 0); 00678 } 00679 00680 /*FUNCTION********************************************************************** 00681 * 00682 * Function Name : SIM_HAL_GetSaiGateCmd 00683 * Description : Get the the clock gate state for SAI module 00684 * This function will get the clock gate state for SAI moudle. 00685 * 00686 *END**************************************************************************/ 00687 bool SIM_HAL_GetSaiGateCmd(uint32_t baseAddr, uint32_t instance) 00688 { 00689 return BR_SIM_SCGC6_I2S(baseAddr); 00690 } 00691 00692 /*FUNCTION********************************************************************** 00693 * 00694 * Function Name : SIM_HAL_EnablePdbClock 00695 * Description : Enable the clock for PDB module 00696 * This function enables the clock for PDB moudle 00697 * 00698 *END**************************************************************************/ 00699 void SIM_HAL_EnablePdbClock(uint32_t baseAddr, uint32_t instance) 00700 { 00701 BW_SIM_SCGC6_PDB(baseAddr, 1); 00702 } 00703 00704 /*FUNCTION********************************************************************** 00705 * 00706 * Function Name : SIM_HAL_DisablePdbClock 00707 * Description : Disable the clock for PDB module 00708 * This function disables the clock for PDB moudle 00709 * 00710 *END**************************************************************************/ 00711 void SIM_HAL_DisablePdbClock(uint32_t baseAddr, uint32_t instance) 00712 { 00713 BW_SIM_SCGC6_PDB(baseAddr, 0); 00714 } 00715 00716 /*FUNCTION********************************************************************** 00717 * 00718 * Function Name : SIM_HAL_GetPdbGateCmd 00719 * Description : Get the the clock gate state for PDB module 00720 * This function will get the clock gate state for PDB moudle. 00721 * 00722 *END**************************************************************************/ 00723 bool SIM_HAL_GetPdbGateCmd(uint32_t baseAddr, uint32_t instance) 00724 { 00725 return BR_SIM_SCGC6_PDB(baseAddr); 00726 } 00727 00728 /*FUNCTION********************************************************************** 00729 * 00730 * Function Name : SIM_HAL_EnableFtmClock 00731 * Description : Enable the clock for FTM module 00732 * This function enables the clock for FTM moudle 00733 * 00734 *END**************************************************************************/ 00735 void SIM_HAL_EnableFtmClock(uint32_t baseAddr, uint32_t instance) 00736 { 00737 switch (instance) 00738 { 00739 case 0: 00740 BW_SIM_SCGC6_FTM0(baseAddr, 1); 00741 break; 00742 case 1: 00743 BW_SIM_SCGC6_FTM1(baseAddr, 1); 00744 break; 00745 case 2: 00746 BW_SIM_SCGC6_FTM2(baseAddr, 1); 00747 break; 00748 case 3: 00749 BW_SIM_SCGC3_FTM3(baseAddr, 1); 00750 break; 00751 default: 00752 break; 00753 } 00754 } 00755 00756 /*FUNCTION********************************************************************** 00757 * 00758 * Function Name : SIM_HAL_DisableFtmClock 00759 * Description : Disable the clock for FTM module 00760 * This function disables the clock for FTM moudle 00761 * 00762 *END**************************************************************************/ 00763 void SIM_HAL_DisableFtmClock(uint32_t baseAddr, uint32_t instance) 00764 { 00765 switch (instance) 00766 { 00767 case 0: 00768 BW_SIM_SCGC6_FTM0(baseAddr, 0); 00769 break; 00770 case 1: 00771 BW_SIM_SCGC6_FTM1(baseAddr, 0); 00772 break; 00773 case 2: 00774 BW_SIM_SCGC6_FTM2(baseAddr, 0); 00775 break; 00776 case 3: 00777 BW_SIM_SCGC3_FTM3(baseAddr, 0); 00778 break; 00779 default: 00780 break; 00781 } 00782 } 00783 00784 /*FUNCTION********************************************************************** 00785 * 00786 * Function Name : SIM_HAL_GetFtmGateCmd 00787 * Description : Get the the clock gate state for FTM module 00788 * This function will get the clock gate state for FTM moudle. 00789 * 00790 *END**************************************************************************/ 00791 bool SIM_HAL_GetFtmGateCmd(uint32_t baseAddr, uint32_t instance) 00792 { 00793 bool retValue = false; 00794 00795 switch (instance) 00796 { 00797 case 0: 00798 retValue = BR_SIM_SCGC6_FTM0(baseAddr); 00799 break; 00800 case 1: 00801 retValue = BR_SIM_SCGC6_FTM1(baseAddr); 00802 break; 00803 case 2: 00804 retValue = BR_SIM_SCGC6_FTM2(baseAddr); 00805 break; 00806 case 3: 00807 retValue = BR_SIM_SCGC3_FTM3(baseAddr); 00808 break; 00809 default: 00810 retValue = false; 00811 break; 00812 } 00813 00814 return retValue; 00815 } 00816 00817 /*FUNCTION********************************************************************** 00818 * 00819 * Function Name : SIM_HAL_EnablePitClock 00820 * Description : Enable the clock for PIT module 00821 * This function enables the clock for PIT moudle 00822 * 00823 *END**************************************************************************/ 00824 void SIM_HAL_EnablePitClock(uint32_t baseAddr, uint32_t instance) 00825 { 00826 BW_SIM_SCGC6_PIT(baseAddr, 1); 00827 } 00828 00829 /*FUNCTION********************************************************************** 00830 * 00831 * Function Name : SIM_HAL_DisablePitClock 00832 * Description : Disable the clock for PIT module 00833 * This function disables the clock for PIT moudle 00834 * 00835 *END**************************************************************************/ 00836 void SIM_HAL_DisablePitClock(uint32_t baseAddr, uint32_t instance) 00837 { 00838 BW_SIM_SCGC6_PIT(baseAddr, 0); 00839 } 00840 00841 /*FUNCTION********************************************************************** 00842 * 00843 * Function Name : SIM_HAL_GetPitGateCmd 00844 * Description : Get the the clock gate state for PIT module 00845 * This function will get the clock gate state for PIT moudle. 00846 * 00847 *END**************************************************************************/ 00848 bool SIM_HAL_GetPitGateCmd(uint32_t baseAddr, uint32_t instance) 00849 { 00850 return BR_SIM_SCGC6_PIT(baseAddr); 00851 } 00852 00853 /*FUNCTION********************************************************************** 00854 * 00855 * Function Name : SIM_HAL_EnableLptimerClock 00856 * Description : Enable the clock for LPTIMER module 00857 * This function enables the clock for LPTIMER moudle 00858 * 00859 *END**************************************************************************/ 00860 void SIM_HAL_EnableLptimerClock(uint32_t baseAddr, uint32_t instance) 00861 { 00862 BW_SIM_SCGC5_LPTMR(baseAddr, 1); 00863 } 00864 00865 /*FUNCTION********************************************************************** 00866 * 00867 * Function Name : SIM_HAL_DisableLptimerClock 00868 * Description : Disable the clock for LPTIMER module 00869 * This function disables the clock for LPTIMER moudle 00870 * 00871 *END**************************************************************************/ 00872 void SIM_HAL_DisableLptimerClock(uint32_t baseAddr, uint32_t instance) 00873 { 00874 BW_SIM_SCGC5_LPTMR(baseAddr, 0); 00875 } 00876 00877 /*FUNCTION********************************************************************** 00878 * 00879 * Function Name : SIM_HAL_GetLptimerGateCmd 00880 * Description : Get the the clock gate state for LPTIMER module 00881 * This function will get the clock gate state for LPTIMER moudle. 00882 * 00883 *END**************************************************************************/ 00884 bool SIM_HAL_GetLptimerGateCmd(uint32_t baseAddr, uint32_t instance) 00885 { 00886 return BR_SIM_SCGC5_LPTMR(baseAddr); 00887 } 00888 00889 /*FUNCTION********************************************************************** 00890 * 00891 * Function Name : SIM_HAL_EnableCmtClock 00892 * Description : Enable the clock for CMT module 00893 * This function enables the clock for CMT moudle 00894 * 00895 *END**************************************************************************/ 00896 void SIM_HAL_EnableCmtClock(uint32_t baseAddr, uint32_t instance) 00897 { 00898 BW_SIM_SCGC4_CMT(baseAddr, 1); 00899 } 00900 00901 /*FUNCTION********************************************************************** 00902 * 00903 * Function Name : SIM_HAL_DisableCmtClock 00904 * Description : Disable the clock for CMT module 00905 * This function disables the clock for CMT moudle 00906 * 00907 *END**************************************************************************/ 00908 void SIM_HAL_DisableCmtClock(uint32_t baseAddr, uint32_t instance) 00909 { 00910 BW_SIM_SCGC4_CMT(baseAddr, 0); 00911 } 00912 00913 /*FUNCTION********************************************************************** 00914 * 00915 * Function Name : SIM_HAL_GetCmtGateCmd 00916 * Description : Get the the clock gate state for CMT module 00917 * This function will get the clock gate state for CMT moudle. 00918 * 00919 *END**************************************************************************/ 00920 bool SIM_HAL_GetCmtGateCmd(uint32_t baseAddr, uint32_t instance) 00921 { 00922 return BR_SIM_SCGC4_CMT(baseAddr); 00923 } 00924 00925 /*FUNCTION********************************************************************** 00926 * 00927 * Function Name : SIM_HAL_EnableRtcClock 00928 * Description : Enable the clock for RTC module 00929 * This function enables the clock for RTC moudle 00930 * 00931 *END**************************************************************************/ 00932 void SIM_HAL_EnableRtcClock(uint32_t baseAddr, uint32_t instance) 00933 { 00934 BW_SIM_SCGC6_RTC(baseAddr, 1); 00935 } 00936 00937 /*FUNCTION********************************************************************** 00938 * 00939 * Function Name : SIM_HAL_DisableRtcClock 00940 * Description : Disable the clock for RTC module 00941 * This function disables the clock for RTC moudle 00942 * 00943 *END**************************************************************************/ 00944 void SIM_HAL_DisableRtcClock(uint32_t baseAddr, uint32_t instance) 00945 { 00946 BW_SIM_SCGC6_RTC(baseAddr, 0); 00947 } 00948 00949 /*FUNCTION********************************************************************** 00950 * 00951 * Function Name : SIM_HAL_GetRtcGateCmd 00952 * Description : Get the the clock gate state for RTC module 00953 * This function will get the clock gate state for RTC moudle. 00954 * 00955 *END**************************************************************************/ 00956 bool SIM_HAL_GetRtcGateCmd(uint32_t baseAddr, uint32_t instance) 00957 { 00958 return BR_SIM_SCGC6_RTC(baseAddr); 00959 } 00960 00961 /*FUNCTION********************************************************************** 00962 * 00963 * Function Name : SIM_HAL_EnableEnetClock 00964 * Description : Enable the clock for ENET module 00965 * This function enables the clock for ENET moudle 00966 * 00967 *END**************************************************************************/ 00968 void SIM_HAL_EnableEnetClock(uint32_t baseAddr, uint32_t instance) 00969 { 00970 BW_SIM_SCGC2_ENET(baseAddr, 1); 00971 } 00972 00973 /*FUNCTION********************************************************************** 00974 * 00975 * Function Name : SIM_HAL_DisableEnetClock 00976 * Description : Disable the clock for ENET module 00977 * This function disables the clock for ENET moudle 00978 * 00979 *END**************************************************************************/ 00980 void SIM_HAL_DisableEnetClock(uint32_t baseAddr, uint32_t instance) 00981 { 00982 BW_SIM_SCGC2_ENET(baseAddr, 0); 00983 } 00984 00985 /*FUNCTION********************************************************************** 00986 * 00987 * Function Name : SIM_HAL_GetEnetGateCmd 00988 * Description : Get the the clock gate state for ENET module 00989 * This function will get the clock gate state for ENET moudle. 00990 * 00991 *END**************************************************************************/ 00992 bool SIM_HAL_GetEnetGateCmd(uint32_t baseAddr, uint32_t instance) 00993 { 00994 return BR_SIM_SCGC2_ENET(baseAddr); 00995 } 00996 00997 /*FUNCTION********************************************************************** 00998 * 00999 * Function Name : SIM_HAL_EnableUsbClock 01000 * Description : Enable the clock for USBFS module 01001 * This function enables the clock for USBFS moudle 01002 * 01003 *END**************************************************************************/ 01004 void SIM_HAL_EnableUsbClock(uint32_t baseAddr, uint32_t instance) 01005 { 01006 BW_SIM_SCGC4_USBOTG(baseAddr, 1); 01007 } 01008 01009 /*FUNCTION********************************************************************** 01010 * 01011 * Function Name : SIM_HAL_DisableUsbClock 01012 * Description : Disable the clock for USBFS module 01013 * This function disables the clock for USBFS moudle 01014 * 01015 *END**************************************************************************/ 01016 void SIM_HAL_DisableUsbClock(uint32_t baseAddr, uint32_t instance) 01017 { 01018 BW_SIM_SCGC4_USBOTG(baseAddr, 0); 01019 } 01020 01021 /*FUNCTION********************************************************************** 01022 * 01023 * Function Name : SIM_HAL_GetUsbGateCmd 01024 * Description : Get the the clock gate state for USB module 01025 * This function will get the clock gate state for USB moudle. 01026 * 01027 *END**************************************************************************/ 01028 bool SIM_HAL_GetUsbGateCmd(uint32_t baseAddr, uint32_t instance) 01029 { 01030 return BR_SIM_SCGC4_USBOTG(baseAddr); 01031 } 01032 01033 /*FUNCTION********************************************************************** 01034 * 01035 * Function Name : SIM_HAL_EnableUsbdcdClock 01036 * Description : Enable the clock for USBDCD module 01037 * This function enables the clock for USBDCD moudle 01038 * 01039 *END**************************************************************************/ 01040 void SIM_HAL_EnableUsbdcdClock(uint32_t baseAddr, uint32_t instance) 01041 { 01042 BW_SIM_SCGC6_USBDCD(baseAddr, 1); 01043 } 01044 01045 /*FUNCTION********************************************************************** 01046 * 01047 * Function Name : SIM_HAL_DisableUsbdcdClock 01048 * Description : Disable the clock for USBDCD module 01049 * This function disables the clock for USBDCD moudle 01050 * 01051 *END**************************************************************************/ 01052 void SIM_HAL_DisableUsbdcdClock(uint32_t baseAddr, uint32_t instance) 01053 { 01054 BW_SIM_SCGC6_USBDCD(baseAddr, 0); 01055 } 01056 01057 /*FUNCTION********************************************************************** 01058 * 01059 * Function Name : SIM_HAL_GetUsbdcdGateCmd 01060 * Description : Get the the clock gate state for USBDCD module 01061 * This function will get the clock gate state for USBDCD moudle. 01062 * 01063 *END**************************************************************************/ 01064 bool SIM_HAL_GetUsbdcdGateCmd(uint32_t baseAddr, uint32_t instance) 01065 { 01066 return BR_SIM_SCGC6_USBDCD(baseAddr); 01067 } 01068 01069 /*FUNCTION********************************************************************** 01070 * 01071 * Function Name : SIM_HAL_EnableFlexcanClock 01072 * Description : Enable the clock for FLEXCAN module 01073 * This function enables the clock for FLEXCAN moudle 01074 * 01075 *END**************************************************************************/ 01076 void SIM_HAL_EnableFlexcanClock(uint32_t baseAddr, uint32_t instance) 01077 { 01078 BW_SIM_SCGC6_FLEXCAN0(baseAddr, 1); 01079 } 01080 01081 /*FUNCTION********************************************************************** 01082 * 01083 * Function Name : SIM_HAL_DisableFlexcanClock 01084 * Description : Disable the clock for FLEXCAN module 01085 * This function disables the clock for FLEXCAN moudle 01086 * 01087 *END**************************************************************************/ 01088 void SIM_HAL_DisableFlexcanClock(uint32_t baseAddr, uint32_t instance) 01089 { 01090 BW_SIM_SCGC6_FLEXCAN0(baseAddr, 0); 01091 } 01092 01093 /*FUNCTION********************************************************************** 01094 * 01095 * Function Name : SIM_HAL_GetFlexcanGateCmd 01096 * Description : Get the the clock gate state for FLEXCAN module 01097 * This function will get the clock gate state for FLEXCAN moudle. 01098 * 01099 *END**************************************************************************/ 01100 bool SIM_HAL_GetFlexcanGateCmd(uint32_t baseAddr, uint32_t instance) 01101 { 01102 return BR_SIM_SCGC6_FLEXCAN0(baseAddr); 01103 } 01104 01105 /*FUNCTION********************************************************************** 01106 * 01107 * Function Name : SIM_HAL_EnableSpiClock 01108 * Description : Enable the clock for SPI module 01109 * This function enables the clock for SPI moudle 01110 * 01111 *END**************************************************************************/ 01112 void SIM_HAL_EnableSpiClock(uint32_t baseAddr, uint32_t instance) 01113 { 01114 switch (instance) 01115 { 01116 case 0: 01117 BW_SIM_SCGC6_SPI0(baseAddr, 1); 01118 break; 01119 case 1: 01120 BW_SIM_SCGC6_SPI1(baseAddr, 1); 01121 break; 01122 case 2: 01123 BW_SIM_SCGC3_SPI2(baseAddr, 1); 01124 break; 01125 default: 01126 break; 01127 } 01128 } 01129 01130 /*FUNCTION********************************************************************** 01131 * 01132 * Function Name : SIM_HAL_DisableSpiClock 01133 * Description : Disable the clock for SPI module 01134 * This function disables the clock for SPI moudle 01135 * 01136 *END**************************************************************************/ 01137 void SIM_HAL_DisableSpiClock(uint32_t baseAddr, uint32_t instance) 01138 { 01139 switch (instance) 01140 { 01141 case 0: 01142 BW_SIM_SCGC6_SPI0(baseAddr, 0); 01143 break; 01144 case 1: 01145 BW_SIM_SCGC6_SPI1(baseAddr, 0); 01146 break; 01147 case 2: 01148 BW_SIM_SCGC3_SPI2(baseAddr, 0); 01149 break; 01150 default: 01151 break; 01152 } 01153 } 01154 01155 /*FUNCTION********************************************************************** 01156 * 01157 * Function Name : SIM_HAL_GetSpiGateCmd 01158 * Description : Get the the clock gate state for SPI module 01159 * This function will get the clock gate state for SPI moudle. 01160 * 01161 *END**************************************************************************/ 01162 bool SIM_HAL_GetSpiGateCmd(uint32_t baseAddr, uint32_t instance) 01163 { 01164 bool retValue = false; 01165 01166 switch (instance) 01167 { 01168 case 0: 01169 retValue = BR_SIM_SCGC6_SPI0(baseAddr); 01170 break; 01171 case 1: 01172 retValue = BR_SIM_SCGC6_SPI1(baseAddr); 01173 break; 01174 case 2: 01175 retValue = BR_SIM_SCGC3_SPI2(baseAddr); 01176 break; 01177 default: 01178 retValue = false; 01179 break; 01180 } 01181 01182 return retValue; 01183 } 01184 01185 /*FUNCTION********************************************************************** 01186 * 01187 * Function Name : SIM_HAL_EnableI2cClock 01188 * Description : Enable the clock for I2C module 01189 * This function enables the clock for I2C moudle 01190 * 01191 *END**************************************************************************/ 01192 void SIM_HAL_EnableI2cClock(uint32_t baseAddr, uint32_t instance) 01193 { 01194 switch (instance) 01195 { 01196 case 0: 01197 BW_SIM_SCGC4_I2C0(baseAddr, 1); 01198 break; 01199 case 1: 01200 BW_SIM_SCGC4_I2C1(baseAddr, 1); 01201 break; 01202 case 2: 01203 BW_SIM_SCGC1_I2C2(baseAddr, 1); 01204 break; 01205 default: 01206 break; 01207 } 01208 } 01209 01210 /*FUNCTION********************************************************************** 01211 * 01212 * Function Name : SIM_HAL_DisableI2cClock 01213 * Description : Disable the clock for I2C module 01214 * This function disables the clock for I2C moudle 01215 * 01216 *END**************************************************************************/ 01217 void SIM_HAL_DisableI2cClock(uint32_t baseAddr, uint32_t instance) 01218 { 01219 switch (instance) 01220 { 01221 case 0: 01222 BW_SIM_SCGC4_I2C0(baseAddr, 0); 01223 break; 01224 case 1: 01225 BW_SIM_SCGC4_I2C1(baseAddr, 0); 01226 break; 01227 case 2: 01228 BW_SIM_SCGC1_I2C2(baseAddr, 0); 01229 break; 01230 default: 01231 break; 01232 } 01233 } 01234 01235 /*FUNCTION********************************************************************** 01236 * 01237 * Function Name : SIM_HAL_GetI2cGateCmd 01238 * Description : Get the the clock gate state for I2C module 01239 * This function will get the clock gate state for I2C moudle. 01240 * 01241 *END**************************************************************************/ 01242 bool SIM_HAL_GetI2cGateCmd(uint32_t baseAddr, uint32_t instance) 01243 { 01244 bool retValue = false; 01245 01246 switch (instance) 01247 { 01248 case 0: 01249 retValue = BR_SIM_SCGC4_I2C0(baseAddr); 01250 break; 01251 case 1: 01252 retValue = BR_SIM_SCGC4_I2C1(baseAddr); 01253 break; 01254 case 2: 01255 retValue = BR_SIM_SCGC1_I2C2(baseAddr); 01256 break; 01257 default: 01258 retValue = false; 01259 break; 01260 } 01261 01262 return retValue; 01263 } 01264 01265 /*FUNCTION********************************************************************** 01266 * 01267 * Function Name : SIM_HAL_EnableUartClock 01268 * Description : Enable the clock for UART module 01269 * This function enables the clock for UART moudle 01270 * 01271 *END**************************************************************************/ 01272 void SIM_HAL_EnableUartClock(uint32_t baseAddr, uint32_t instance) 01273 { 01274 switch (instance) 01275 { 01276 case 0: 01277 BW_SIM_SCGC4_UART0(baseAddr, 1); 01278 break; 01279 case 1: 01280 BW_SIM_SCGC4_UART1(baseAddr, 1); 01281 break; 01282 case 2: 01283 BW_SIM_SCGC4_UART2(baseAddr, 1); 01284 break; 01285 case 3: 01286 BW_SIM_SCGC4_UART3(baseAddr, 1); 01287 break; 01288 case 4: 01289 BW_SIM_SCGC1_UART4(baseAddr, 1); 01290 break; 01291 case 5: 01292 BW_SIM_SCGC1_UART5(baseAddr, 1); 01293 break; 01294 default: 01295 break; 01296 } 01297 } 01298 01299 /*FUNCTION********************************************************************** 01300 * 01301 * Function Name : SIM_HAL_DisableUartClock 01302 * Description : Disable the clock for UART module 01303 * This function disables the clock for UART moudle 01304 * 01305 *END**************************************************************************/ 01306 void SIM_HAL_DisableUartClock(uint32_t baseAddr, uint32_t instance) 01307 { 01308 switch (instance) 01309 { 01310 case 0: 01311 BW_SIM_SCGC4_UART0(baseAddr, 0); 01312 break; 01313 case 1: 01314 BW_SIM_SCGC4_UART1(baseAddr, 0); 01315 break; 01316 case 2: 01317 BW_SIM_SCGC4_UART2(baseAddr, 0); 01318 break; 01319 case 3: 01320 BW_SIM_SCGC4_UART3(baseAddr, 0); 01321 break; 01322 case 4: 01323 BW_SIM_SCGC1_UART4(baseAddr, 0); 01324 break; 01325 case 5: 01326 BW_SIM_SCGC1_UART5(baseAddr, 0); 01327 break; 01328 default: 01329 break; 01330 } 01331 } 01332 01333 /*FUNCTION********************************************************************** 01334 * 01335 * Function Name : SIM_HAL_GetUartGateCmd 01336 * Description : Get the the clock gate state for UART module 01337 * This function will get the clock gate state for UART moudle. 01338 * 01339 *END**************************************************************************/ 01340 bool SIM_HAL_GetUartGateCmd(uint32_t baseAddr, uint32_t instance) 01341 { 01342 bool retValue = false; 01343 01344 switch (instance) 01345 { 01346 case 0: 01347 retValue = BR_SIM_SCGC4_UART0(baseAddr); 01348 break; 01349 case 1: 01350 retValue = BR_SIM_SCGC4_UART1(baseAddr); 01351 break; 01352 case 2: 01353 retValue = BR_SIM_SCGC4_UART2(baseAddr); 01354 break; 01355 case 3: 01356 retValue = BR_SIM_SCGC4_UART3(baseAddr); 01357 break; 01358 case 4: 01359 retValue = BR_SIM_SCGC1_UART4(baseAddr); 01360 break; 01361 case 5: 01362 retValue = BR_SIM_SCGC1_UART5(baseAddr); 01363 break; 01364 default: 01365 retValue = false; 01366 break; 01367 } 01368 01369 return retValue; 01370 } 01371 01372 /*FUNCTION********************************************************************** 01373 * 01374 * Function Name : SIM_HAL_EnableSdhcClock 01375 * Description : Enable the clock for SDHC module 01376 * This function enables the clock for SDHC moudle 01377 * 01378 *END**************************************************************************/ 01379 void SIM_HAL_EnableSdhcClock(uint32_t baseAddr, uint32_t instance) 01380 { 01381 BW_SIM_SCGC3_SDHC(baseAddr, 1); 01382 } 01383 01384 /*FUNCTION********************************************************************** 01385 * 01386 * Function Name : SIM_HAL_DisableSdhcClock 01387 * Description : Disable the clock for SDHC module 01388 * This function disables the clock for SDHC moudle 01389 * 01390 *END**************************************************************************/ 01391 void SIM_HAL_DisableSdhcClock(uint32_t baseAddr, uint32_t instance) 01392 { 01393 BW_SIM_SCGC3_SDHC(baseAddr, 0); 01394 } 01395 01396 /*FUNCTION********************************************************************** 01397 * 01398 * Function Name : SIM_HAL_GetSdhcGateCmd 01399 * Description : Get the the clock gate state for SDHC module 01400 * This function will get the clock gate state for SDHC moudle. 01401 * 01402 *END**************************************************************************/ 01403 bool SIM_HAL_GetSdhcGateCmd(uint32_t baseAddr, uint32_t instance) 01404 { 01405 return BR_SIM_SCGC3_SDHC(baseAddr); 01406 } 01407 /******************************************************************************* 01408 * EOF 01409 ******************************************************************************/ 01410
Generated on Sat Aug 27 2022 17:08:59 by
