MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
XBARA: Inter-Peripheral Crossbar Switch

Overview

The MCUXpresso SDK provides a peripheral driver for the Inter-Peripheral Crossbar Switch (XBARA) block of MCUXpresso SDK devices.

The XBARA peripheral driver configures the XBARA (Inter-Peripheral Crossbar Switch) and handles initialization and configuration of the XBARA module.

XBARA driver has two parts:

Function

XBARA Initialization

To initialize the XBARA driver, a state structure has to be passed into the initialization function. This block of memory keeps pointers to user's callback functions and parameters to these functions. The XBARA module is initialized by calling the XBARA_Init() function.

Call diagram

  1. Call the "XBARA_Init()" function to initialize the XBARA module.
  2. Optionally, call the "XBARA_SetSignalsConnection()" function to Set connection between the selected XBARA_IN[*] input and the XBARA_OUT[*] output signal. It connects the XBARA input to the selected XBARA output. A configuration structure of the "xbara_input_signal_t" type and "xbara_output_signal_t" type is required.
  3. Call the "XBARA_SetOutputSignalConfig" function to set the active edge features, such interrupts or DMA requests. A configuration structure of the "xbara_control_config_t" type is required to point to structure that keeps configuration of control register.
  4. Finally, the XBARA works properly.

Typical use case

Data Structures

struct  xbara_control_config_t
 Defines the configuration structure of the XBARA control register. More...
 

Enumerations

enum  xbara_active_edge_t {
  kXBARA_EdgeNone = 0U,
  kXBARA_EdgeRising = 1U,
  kXBARA_EdgeFalling = 2U,
  kXBARA_EdgeRisingAndFalling = 3U
}
 XBARA active edge for detection. More...
 
enum  xbara_request_t {
  kXBARA_RequestDisable = 0U,
  kXBARA_RequestDMAEnable = 1U,
  kXBARA_RequestInterruptEnalbe = 2U
}
 Defines the XBARA DMA and interrupt configurations. More...
 
enum  xbara_status_flag_t {
  kXBARA_EdgeDetectionOut0,
  kXBARA_EdgeDetectionOut1,
  kXBARA_EdgeDetectionOut2,
  kXBARA_EdgeDetectionOut3
}
 XBARA status flags. More...
 

XBARA functional Operation.

void XBARA_Init (XBARA_Type *base)
 Initializes the XBARA module. More...
 
void XBARA_Deinit (XBARA_Type *base)
 Shuts down the XBARA module. More...
 
void XBARA_SetSignalsConnection (XBARA_Type *base, xbar_input_signal_t input, xbar_output_signal_t output)
 Sets a connection between the selected XBARA_IN[*] input and the XBARA_OUT[*] output signal. More...
 
uint32_t XBARA_GetStatusFlags (XBARA_Type *base)
 Gets the active edge detection status. More...
 
void XBARA_ClearStatusFlags (XBARA_Type *base, uint32_t mask)
 Clears the edge detection status flags of relative mask. More...
 
void XBARA_SetOutputSignalConfig (XBARA_Type *base, xbar_output_signal_t output, const xbara_control_config_t *controlConfig)
 Configures the XBARA control register. More...
 

Data Structure Documentation

struct xbara_control_config_t

This structure keeps the configuration of XBARA control register for one output. Control registers are available only for a few outputs. Not every XBARA module has control registers.

Data Fields

xbara_active_edge_t activeEdge
 Active edge to be detected. More...
 
xbara_request_t requestType
 Selects DMA/Interrupt request. More...
 

Field Documentation

xbara_active_edge_t xbara_control_config_t::activeEdge
xbara_request_t xbara_control_config_t::requestType

Enumeration Type Documentation

Enumerator
kXBARA_EdgeNone 

Edge detection status bit never asserts.

kXBARA_EdgeRising 

Edge detection status bit asserts on rising edges.

kXBARA_EdgeFalling 

Edge detection status bit asserts on falling edges.

kXBARA_EdgeRisingAndFalling 

Edge detection status bit asserts on rising and falling edges.

Enumerator
kXBARA_RequestDisable 

Interrupt and DMA are disabled.

kXBARA_RequestDMAEnable 

DMA enabled, interrupt disabled.

kXBARA_RequestInterruptEnalbe 

Interrupt enabled, DMA disabled.

This provides constants for the XBARA status flags for use in the XBARA functions.

Enumerator
kXBARA_EdgeDetectionOut0 

XBAR_OUT0 active edge interrupt flag, sets when active edge detected.

kXBARA_EdgeDetectionOut1 

XBAR_OUT1 active edge interrupt flag, sets when active edge detected.

kXBARA_EdgeDetectionOut2 

XBAR_OUT2 active edge interrupt flag, sets when active edge detected.

kXBARA_EdgeDetectionOut3 

XBAR_OUT3 active edge interrupt flag, sets when active edge detected.

Function Documentation

void XBARA_Init ( XBARA_Type *  base)

This function un-gates the XBARA clock.

Parameters
baseXBARA peripheral address.
void XBARA_Deinit ( XBARA_Type *  base)

This function disables XBARA clock.

Parameters
baseXBARA peripheral address.
void XBARA_SetSignalsConnection ( XBARA_Type *  base,
xbar_input_signal_t  input,
xbar_output_signal_t  output 
)

This function connects the XBARA input to the selected XBARA output. If more than one XBARA module is available, only the inputs and outputs from the same module can be connected.

Example:

XBARA_SetSignalsConnection(XBARA, kXBARA_InputPIT_TRG0, kXBARA_OutputDMAMUX18);
Parameters
baseXBARA peripheral address.
inputXBARA input signal.
outputXBARA output signal.
uint32_t XBARA_GetStatusFlags ( XBARA_Type *  base)

This function gets the active edge detect status of all XBARA_OUTs. If the active edge occurs, the return value is asserted. When the interrupt or the DMA functionality is enabled for the XBARA_OUTx, this field is 1 when the interrupt or DMA request is asserted and 0 when the interrupt or DMA request has been cleared.

Parameters
baseXBARA peripheral address.
Returns
the mask of these status flag bits.
void XBARA_ClearStatusFlags ( XBARA_Type *  base,
uint32_t  mask 
)
Parameters
baseXBARA peripheral address.
maskthe status flags to clear.
void XBARA_SetOutputSignalConfig ( XBARA_Type *  base,
xbar_output_signal_t  output,
const xbara_control_config_t controlConfig 
)

This function configures an XBARA control register. The active edge detection and the DMA/IRQ function on the corresponding XBARA output can be set.

Example:

XBARA_SetOutputSignalConfig(XBARA, kXBARA_OutputDMAMUX18, &userConfig);
Parameters
baseXBARA peripheral address.
outputXBARA output number.
controlConfigPointer to structure that keeps configuration of control register.