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 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * o Redistributions of source code must retain the above copyright notice, this 9 * list of conditions and the following disclaimer. 10 * 11 * o Redistributions in binary form must reproduce the above copyright notice, 12 * this list of conditions and the following disclaimer in the documentation 13 * and/or 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" 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef __CLOCK_FREQ_H__ 33 #define __CLOCK_FREQ_H__ 34 35 #include "device_imx.h" 36 37 /*! 38 * @addtogroup clock_freq_helper 39 * @{ 40 */ 41 42 /******************************************************************************* 43 * API 44 ******************************************************************************/ 45 46 #if defined(__cplusplus) 47 extern "C" { 48 #endif 49 50 /*! 51 * @brief Get clock frequency applies to the GPT module 52 * 53 * @param base GPT base pointer. 54 * @return clock frequency (in HZ) applies to the GPT module 55 */ 56 uint32_t get_gpt_clock_freq(GPT_Type *base); 57 58 /*! 59 * @brief Get clock frequency applies to the ECSPI module 60 * 61 * @param base ECSPI base pointer. 62 * @return clock frequency (in HZ) applies to the ECSPI module 63 */ 64 uint32_t get_ecspi_clock_freq(ECSPI_Type *base); 65 66 /*! 67 * @brief Get clock frequency applies to the FLEXCAN module 68 * 69 * @param base CAN base pointer. 70 * @return clock frequency (in HZ) applies to the FLEXCAN module 71 */ 72 uint32_t get_flexcan_clock_freq(CAN_Type *base); 73 74 /*! 75 * @brief Get clock frequency applies to the I2C module 76 * 77 * @param base I2C base pointer. 78 * @return clock frequency (in HZ) applies to the I2C module 79 */ 80 uint32_t get_i2c_clock_freq(I2C_Type *base); 81 82 /*! 83 * @brief Get clock frequency applies to the UART module 84 * 85 * @param base UART base pointer. 86 * @return clock frequency (in HZ) applies to the UART module 87 */ 88 uint32_t get_uart_clock_freq(UART_Type *base); 89 90 #if defined(__cplusplus) 91 } 92 #endif 93 94 /*! @}*/ 95 96 #endif /* __CLOCK_FREQ_H__ */ 97 /******************************************************************************* 98 * EOF 99 ******************************************************************************/ 100