fsl_inputmux.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  4. * Copyright 2016-2017 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of the copyright holder nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef _FSL_INPUTMUX_H_
  35. #define _FSL_INPUTMUX_H_
  36. #include "fsl_inputmux_connections.h"
  37. #include "fsl_common.h"
  38. /*!
  39. * @addtogroup inputmux_driver
  40. * @{
  41. */
  42. /*! @file */
  43. /*! @file fsl_inputmux_connections.h */
  44. /*******************************************************************************
  45. * Definitions
  46. ******************************************************************************/
  47. /*! @name Driver version */
  48. /*@{*/
  49. /*! @brief Group interrupt driver version for SDK */
  50. #define FSL_INPUTMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) /*!< Version 2.0.0. */
  51. /*@}*/
  52. /*******************************************************************************
  53. * API
  54. ******************************************************************************/
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. /*!
  59. * @brief Initialize INPUTMUX peripheral.
  60. * This function enables the INPUTMUX clock.
  61. *
  62. * @param base Base address of the INPUTMUX peripheral.
  63. *
  64. * @retval None.
  65. */
  66. void INPUTMUX_Init(INPUTMUX_Type *base);
  67. /*!
  68. * @brief Attaches a signal
  69. *
  70. * This function gates the INPUTPMUX clock.
  71. *
  72. * @param base Base address of the INPUTMUX peripheral.
  73. * @param index Destination peripheral to attach the signal to.
  74. * @param connection Selects connection.
  75. *
  76. * @retval None.
  77. */
  78. void INPUTMUX_AttachSignal(INPUTMUX_Type *base, uint32_t index, inputmux_connection_t connection);
  79. #if defined(FSL_FEATURE_INPUTMUX_HAS_SIGNAL_ENA)
  80. /*!
  81. * @brief Enable/disable a signal
  82. *
  83. * This function gates the INPUTPMUX clock.
  84. *
  85. * @param base Base address of the INPUTMUX peripheral.
  86. * @param signal Enable signal register id and bit offset.
  87. * @param enable Selects enable or disable.
  88. *
  89. * @retval None.
  90. */
  91. void INPUTMUX_EnableSignal(INPUTMUX_Type *base, inputmux_signal_t signal, bool enable);
  92. #endif
  93. /*!
  94. * @brief Deinitialize INPUTMUX peripheral.
  95. * This function disables the INPUTMUX clock.
  96. *
  97. * @param base Base address of the INPUTMUX peripheral.
  98. *
  99. * @retval None.
  100. */
  101. void INPUTMUX_Deinit(INPUTMUX_Type *base);
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. /*@}*/
  106. #endif /* _FSL_INPUTMUX_H_ */