fsl_xbarb.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2015, Freescale Semiconductor, Inc.
  3. * Copyright 2016-2019 NXP
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: BSD-3-Clause
  7. */
  8. #ifndef _FSL_XBARB_H_
  9. #define _FSL_XBARB_H_
  10. #include "fsl_common.h"
  11. /*!
  12. * @addtogroup xbarb
  13. * @{
  14. */
  15. /*******************************************************************************
  16. * Definitions
  17. ******************************************************************************/
  18. #define FSL_XBARB_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
  19. /* Macros for entire XBARB_SELx register. */
  20. #define XBARB_SELx(base, output) (((volatile uint16_t *)(&((base)->SEL0)))[(uint32_t)(output) / 2UL])
  21. /* Set the SELx field to a new value. */
  22. #define XBARB_WR_SELx_SELx(base, input, output) XBARB_SetSignalsConnection((base), (input), (output))
  23. /*******************************************************************************
  24. * API
  25. ******************************************************************************/
  26. #if defined(__cplusplus)
  27. extern "C" {
  28. #endif /* __cplusplus */
  29. /*!
  30. * @name XBARB functional Operation.
  31. * @{
  32. */
  33. /*!
  34. * @brief Initializes the XBARB module.
  35. *
  36. * This function un-gates the XBARB clock.
  37. *
  38. * @param base XBARB peripheral address.
  39. */
  40. void XBARB_Init(XBARB_Type *base);
  41. /*!
  42. * @brief Shuts down the XBARB module.
  43. *
  44. * This function disables XBARB clock.
  45. *
  46. * @param base XBARB peripheral address.
  47. */
  48. void XBARB_Deinit(XBARB_Type *base);
  49. /*!
  50. * @brief Configures a connection between the selected XBARB_IN[*] input and the XBARB_OUT[*] output signal.
  51. *
  52. * This function configures which XBARB input is connected to the selected XBARB output.
  53. * If more than one XBARB module is available, only the inputs and outputs from the same module
  54. * can be connected.
  55. *
  56. * @param base XBARB peripheral address.
  57. * @param input XBARB input signal.
  58. * @param output XBARB output signal.
  59. */
  60. void XBARB_SetSignalsConnection(XBARB_Type *base, xbar_input_signal_t input, xbar_output_signal_t output);
  61. #if defined(__cplusplus)
  62. }
  63. #endif /* __cplusplus */
  64. /*! @}*/
  65. /*!* @} */
  66. #endif /* _FSL_XBARB_H_ */