1 /* 2 * Copyright (c) 2016, Freescale Semiconductor, Inc. 3 * Copyright 2016-2021, 2023 NXP 4 * All rights reserved. 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 */ 8 9 #ifndef FSL_INPUTMUX_H_ 10 #define FSL_INPUTMUX_H_ 11 12 #include "fsl_inputmux_connections.h" 13 #include "fsl_common.h" 14 15 /*! 16 * @addtogroup inputmux_driver 17 * @{ 18 */ 19 20 /*! @file */ 21 /*! @file fsl_inputmux_connections.h */ 22 23 /******************************************************************************* 24 * Definitions 25 ******************************************************************************/ 26 27 /*! @name Driver version */ 28 /*! @{ */ 29 /*! @brief Group interrupt driver version for SDK */ 30 #define FSL_INPUTMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 7)) 31 /*! @} */ 32 33 /******************************************************************************* 34 * API 35 ******************************************************************************/ 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 /*! 42 * @brief Initialize INPUTMUX peripheral. 43 44 * This function enables the INPUTMUX clock. 45 * 46 * @param base Base address of the INPUTMUX peripheral. 47 * 48 * @retval None. 49 */ 50 void INPUTMUX_Init(INPUTMUX_Type *base); 51 52 /*! 53 * @brief Attaches a signal 54 * 55 * This function attaches multiplexed signals from INPUTMUX to target signals. 56 * For example, to attach GPIO PORT0 Pin 5 to PINT peripheral, do the following: 57 * @code 58 * INPUTMUX_AttachSignal(INPUTMUX, 2, kINPUTMUX_GpioPort0Pin5ToPintsel); 59 * @endcode 60 * In this example, INTMUX has 8 registers for PINT, PINT_SEL0~PINT_SEL7. 61 * With parameter @p index specified as 2, this function configures register PINT_SEL2. 62 * 63 * @param base Base address of the INPUTMUX peripheral. 64 * @param index The serial number of destination register in the group of INPUTMUX registers with same name. 65 * @param connection Applies signal from source signals collection to target signal. 66 * 67 * @retval None. 68 */ 69 void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection); 70 71 #if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA) 72 /*! 73 * @brief Enable/disable a signal 74 * 75 * This function gates the INPUTPMUX clock. 76 * 77 * @param base Base address of the INPUTMUX peripheral. 78 * @param signal Enable signal register id and bit offset. 79 * @param enable Selects enable or disable. 80 * 81 * @retval None. 82 */ 83 void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable); 84 #endif 85 86 /*! 87 * @brief Deinitialize INPUTMUX peripheral. 88 89 * This function disables the INPUTMUX clock. 90 * 91 * @param base Base address of the INPUTMUX peripheral. 92 * 93 * @retval None. 94 */ 95 void INPUTMUX_Deinit(INPUTMUX_Type *base); 96 97 #ifdef __cplusplus 98 } 99 #endif 100 101 /*! @} */ 102 103 #endif /* FSL_INPUTMUX_H_ */ 104