1 /* 2 * Copyright (c) 2015, Freescale Semiconductor, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, 6 * are permitted provided that the following conditions are met: 7 * 8 * o Redistributions of source code must retain the above copyright notice, this list 9 * of conditions and the following disclaimer. 10 * 11 * o Redistributions in binary form must reproduce the above copyright notice, this 12 * list of conditions and the following disclaimer in the documentation and/or 13 * other materials provided with the distribution. 14 * 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its 16 * contributors may be used to endorse or promote products derived from this 17 * software without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #ifndef __CLOCK_FREQ_H__ 32 #define __CLOCK_FREQ_H__ 33 34 #include "device_imx.h" 35 36 /*! 37 * @addtogroup clock_freq_helper 38 * @{ 39 */ 40 41 /******************************************************************************* 42 * API 43 ******************************************************************************/ 44 45 #if defined(__cplusplus) 46 extern "C" { 47 #endif 48 49 /*! 50 * @brief Get clock frequency applys to the EPIT module 51 * 52 * @param base EPIT base pointer. 53 * @return clock frequency (in HZ) applys to the EPIT module 54 */ 55 uint32_t get_epit_clock_freq(EPIT_Type* base); 56 57 /*! 58 * @brief Get clock frequency applys to the I2C module 59 * 60 * @param base I2C base pointer. 61 * @return clock frequency (in HZ) applys to the I2C module 62 */ 63 uint32_t get_i2c_clock_freq(I2C_Type* base); 64 65 /*! 66 * @brief Get clock frequency applys to the ECSPI module 67 * 68 * @param base ECSPI base pointer. 69 * @return clock frequency (in HZ) applys to the ECSPI module 70 */ 71 uint32_t get_ecspi_clock_freq(ECSPI_Type* base); 72 73 /*! 74 * @brief Get clock frequency applys to the UART module 75 * 76 * @param base UART base pointer. 77 * @return clock frequency (in HZ) applys to the UART module 78 */ 79 uint32_t get_uart_clock_freq(UART_Type* base); 80 81 #if defined(__cplusplus) 82 } 83 #endif 84 85 /*! @}*/ 86 87 #endif /* __CLOCK_FREQ_H__ */ 88 /******************************************************************************* 89 * EOF 90 ******************************************************************************/ 91