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 
9 #ifndef _FSL_XBARB_H_
10 #define _FSL_XBARB_H_
11 
12 #include "fsl_common.h"
13 
14 /*!
15  * @addtogroup xbarb
16  * @{
17  */
18 
19 /*******************************************************************************
20  * Definitions
21  ******************************************************************************/
22 
23 #define FSL_XBARB_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
24 
25 /* Macros for entire XBARB_SELx register. */
26 #define XBARB_SELx(base, output) (((volatile uint16_t *)(&((base)->SEL0)))[(uint32_t)(output) / 2UL])
27 /* Set the SELx field to a new value. */
28 #define XBARB_WR_SELx_SELx(base, input, output) XBARB_SetSignalsConnection((base), (input), (output))
29 
30 /*******************************************************************************
31  * API
32  ******************************************************************************/
33 
34 #if defined(__cplusplus)
35 extern "C" {
36 #endif /* __cplusplus */
37 
38 /*!
39  * @name XBARB functional Operation.
40  * @{
41  */
42 
43 /*!
44  * @brief Initializes the XBARB module.
45  *
46  * This function un-gates the XBARB clock.
47  *
48  * @param base XBARB peripheral address.
49  */
50 void XBARB_Init(XBARB_Type *base);
51 
52 /*!
53  * @brief Shuts down the XBARB module.
54  *
55  * This function disables XBARB clock.
56  *
57  * @param base XBARB peripheral address.
58  */
59 void XBARB_Deinit(XBARB_Type *base);
60 
61 /*!
62  * @brief Configures a connection between the selected XBARB_IN[*] input and the XBARB_OUT[*] output signal.
63  *
64  * This function configures which XBARB input is connected to the selected XBARB output.
65  * If more than one XBARB module is available, only the inputs and outputs from the same module
66  * can be connected.
67  *
68  * @param base XBARB peripheral address.
69  * @param input XBARB input signal.
70  * @param output XBARB output signal.
71  */
72 void XBARB_SetSignalsConnection(XBARB_Type *base, xbar_input_signal_t input, xbar_output_signal_t output);
73 
74 #if defined(__cplusplus)
75 }
76 #endif /* __cplusplus */
77 
78 /*! @}*/
79 
80 /*!* @} */
81 
82 #endif /* _FSL_XBARB_H_ */
83