NetBurner 3.5.6
PDF Version
fsl_xbara.h
1#ifndef DOXYGEN_SHOULD_SKIP_THIS
2
3/*
4 * Copyright (c) 2015, Freescale Semiconductor, Inc.
5 * Copyright 2016-2019, 2022 NXP
6 * All rights reserved.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11#ifndef FSL_XBARA_H_
12#define FSL_XBARA_H_
13
14#include "fsl_common.h"
15#include "MIMXRT1061_features.h"
16
17
23/*******************************************************************************
24 * Definitions
25 ******************************************************************************/
26
27#define FSL_XBARA_DRIVER_VERSION (MAKE_VERSION(2, 0, 5))
28
29/* Macros for entire XBARA_SELx register. */
30#define XBARA_SELx(base, output) (((volatile uint16_t *)(&((base)->SEL0)))[(uint32_t)(output) / 2UL])
31
32/* Set the XBARA_SELx_SELx field to a new value. */
33#define XBARA_WR_SELx_SELx(base, input, output) XBARA_SetSignalsConnection((base), (input), (output))
34
35/* For driver backward compatibility. */
36#define kXBARA_RequestInterruptEnalbe kXBARA_RequestInterruptEnable
37
41typedef enum _xbara_active_edge
42{
43 kXBARA_EdgeNone = 0U,
44 kXBARA_EdgeRising = 1U,
45 kXBARA_EdgeFalling = 2U,
46 kXBARA_EdgeRisingAndFalling = 3U
47} xbara_active_edge_t;
48
52typedef enum _xbar_request
53{
54 kXBARA_RequestDisable = 0U,
55 kXBARA_RequestDMAEnable = 1U,
56 kXBARA_RequestInterruptEnable = 2U
57} xbara_request_t;
58
64typedef enum _xbara_status_flag_t
65{
66 kXBARA_EdgeDetectionOut0 =
67 (XBARA_CTRL0_STS0_MASK),
68 kXBARA_EdgeDetectionOut1 =
69 (XBARA_CTRL0_STS1_MASK),
70 kXBARA_EdgeDetectionOut2 =
71 (XBARA_CTRL1_STS2_MASK << 16U),
72 kXBARA_EdgeDetectionOut3 =
73 (XBARA_CTRL1_STS3_MASK << 16U),
74} xbara_status_flag_t;
75
83typedef struct XBARAControlConfig
84{
85 xbara_active_edge_t activeEdge;
86 xbara_request_t requestType;
87} xbara_control_config_t;
88
89/*******************************************************************************
90 * API
91 ******************************************************************************/
92
93#if defined(__cplusplus)
94extern "C" {
95#endif /* __cplusplus */
96
109void XBARA_Init(XBARA_Type *base);
110
118void XBARA_Deinit(XBARA_Type *base);
119
136void XBARA_SetSignalsConnection(XBARA_Type *base, xbar_input_signal_t input, xbar_output_signal_t output);
137
150uint32_t XBARA_GetStatusFlags(XBARA_Type *base);
151
158void XBARA_ClearStatusFlags(XBARA_Type *base, uint32_t mask);
159
178void XBARA_SetOutputSignalConfig(XBARA_Type *base,
179 xbar_output_signal_t output,
180 const xbara_control_config_t *controlConfig);
181
182#if defined(__cplusplus)
183}
184#endif /* __cplusplus */
185
188/*!* @} */
189
190#endif /* FSL_XBARA_H_ */
191
192#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS