MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
PLU: Programmable Logic Unit

Overview

The MCUXpresso SDK provides a peripheral driver for the Programmable Logic Unit module of MCUXpresso SDK devices.

Typical use case

Example use of PLU API. Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/plu/

Enumerations

enum  plu_lut_index_t {
  kPLU_LUT_0 = 0U,
  kPLU_LUT_1 = 1U,
  kPLU_LUT_2 = 2U,
  kPLU_LUT_3 = 3U,
  kPLU_LUT_4 = 4U,
  kPLU_LUT_5 = 5U,
  kPLU_LUT_6 = 6U,
  kPLU_LUT_7 = 7U,
  kPLU_LUT_8 = 8U,
  kPLU_LUT_9 = 9U,
  kPLU_LUT_10 = 10U,
  kPLU_LUT_11 = 11U,
  kPLU_LUT_12 = 12U,
  kPLU_LUT_13 = 13U,
  kPLU_LUT_14 = 14U,
  kPLU_LUT_15 = 15U,
  kPLU_LUT_16 = 16U,
  kPLU_LUT_17 = 17U,
  kPLU_LUT_18 = 18U,
  kPLU_LUT_19 = 19U,
  kPLU_LUT_20 = 20U,
  kPLU_LUT_21 = 21U,
  kPLU_LUT_22 = 22U,
  kPLU_LUT_23 = 23U,
  kPLU_LUT_24 = 24U,
  kPLU_LUT_25 = 25U
}
 Index of LUT. More...
 
enum  plu_lut_in_index_t {
  kPLU_LUT_IN_0 = 0U,
  kPLU_LUT_IN_1 = 1U,
  kPLU_LUT_IN_2 = 2U,
  kPLU_LUT_IN_3 = 3U,
  kPLU_LUT_IN_4 = 4U
}
 Inputs of LUT. More...
 
enum  plu_lut_input_source_t {
  kPLU_LUT_IN_SRC_PLU_IN_0 = 0U,
  kPLU_LUT_IN_SRC_PLU_IN_1 = 1U,
  kPLU_LUT_IN_SRC_PLU_IN_2 = 2U,
  kPLU_LUT_IN_SRC_PLU_IN_3 = 3U,
  kPLU_LUT_IN_SRC_PLU_IN_4 = 4U,
  kPLU_LUT_IN_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. More...
 
enum  plu_output_index_t {
  kPLU_OUTPUT_0 = 0U,
  kPLU_OUTPUT_1 = 1U,
  kPLU_OUTPUT_2 = 2U,
  kPLU_OUTPUT_3 = 3U,
  kPLU_OUTPUT_4 = 4U,
  kPLU_OUTPUT_5 = 5U,
  kPLU_OUTPUT_6 = 6U,
  kPLU_OUTPUT_7 = 7U
}
 PLU output multiplexer registers. More...
 
enum  plu_output_source_t {
  kPLU_OUT_SRC_LUT_0 = 0U,
  kPLU_OUT_SRC_LUT_1 = 1U,
  kPLU_OUT_SRC_LUT_2 = 2U,
  kPLU_OUT_SRC_LUT_3 = 3U,
  kPLU_OUT_SRC_LUT_4 = 4U,
  kPLU_OUT_SRC_LUT_5 = 5U,
  kPLU_OUT_SRC_LUT_6 = 6U,
  kPLU_OUT_SRC_LUT_7 = 7U,
  kPLU_OUT_SRC_LUT_8 = 8U,
  kPLU_OUT_SRC_LUT_9 = 9U,
  kPLU_OUT_SRC_LUT_10 = 10U,
  kPLU_OUT_SRC_LUT_11 = 11U,
  kPLU_OUT_SRC_LUT_12 = 12U,
  kPLU_OUT_SRC_LUT_13 = 13U,
  kPLU_OUT_SRC_LUT_14 = 14U,
  kPLU_OUT_SRC_LUT_15 = 15U,
  kPLU_OUT_SRC_LUT_16 = 16U,
  kPLU_OUT_SRC_LUT_17 = 17U,
  kPLU_OUT_SRC_LUT_18 = 18U,
  kPLU_OUT_SRC_LUT_19 = 19U,
  kPLU_OUT_SRC_LUT_20 = 20U,
  kPLU_OUT_SRC_LUT_21 = 21U,
  kPLU_OUT_SRC_LUT_22 = 22U,
  kPLU_OUT_SRC_LUT_23 = 23U,
  kPLU_OUT_SRC_LUT_24 = 24U,
  kPLU_OUT_SRC_LUT_25 = 25U,
  kPLU_OUT_SRC_FLIPFLOP_0 = 26U,
  kPLU_OUT_SRC_FLIPFLOP_1 = 27U,
  kPLU_OUT_SRC_FLIPFLOP_2 = 28U,
  kPLU_OUT_SRC_FLIPFLOP_3 = 29U
}
 Available sources of PLU output. More...
 

Driver version

#define FSL_PLU_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 Version 2.0.1.
 

Initialization and deinitialization

void PLU_Init (PLU_Type *base)
 Ungates the PLU clock and reset the module. More...
 
void PLU_Deinit (PLU_Type *base)
 Gate the PLU clock. More...
 

Set input/output source and Truth Table

static void PLU_SetLutInputSource (PLU_Type *base, plu_lut_index_t lutIndex, plu_lut_in_index_t lutInIndex, plu_lut_input_source_t inputSrc)
 Set Input source of LUT. More...
 
static void PLU_SetOutputSource (PLU_Type *base, plu_output_index_t outputIndex, plu_output_source_t outputSrc)
 Set Output source of PLU. More...
 
static void PLU_SetLutTruthTable (PLU_Type *base, plu_lut_index_t lutIndex, uint32_t truthTable)
 Set Truth Table of LUT. More...
 

Read current Output State

static uint32_t PLU_ReadOutputState (PLU_Type *base)
 Read the current state of the 8 designated PLU Outputs. More...
 

Enumeration Type Documentation

Enumerator
kPLU_LUT_0 

5-input Look-up Table 0

kPLU_LUT_1 

5-input Look-up Table 1

kPLU_LUT_2 

5-input Look-up Table 2

kPLU_LUT_3 

5-input Look-up Table 3

kPLU_LUT_4 

5-input Look-up Table 4

kPLU_LUT_5 

5-input Look-up Table 5

kPLU_LUT_6 

5-input Look-up Table 6

kPLU_LUT_7 

5-input Look-up Table 7

kPLU_LUT_8 

5-input Look-up Table 8

kPLU_LUT_9 

5-input Look-up Table 9

kPLU_LUT_10 

5-input Look-up Table 10

kPLU_LUT_11 

5-input Look-up Table 11

kPLU_LUT_12 

5-input Look-up Table 12

kPLU_LUT_13 

5-input Look-up Table 13

kPLU_LUT_14 

5-input Look-up Table 14

kPLU_LUT_15 

5-input Look-up Table 15

kPLU_LUT_16 

5-input Look-up Table 16

kPLU_LUT_17 

5-input Look-up Table 17

kPLU_LUT_18 

5-input Look-up Table 18

kPLU_LUT_19 

5-input Look-up Table 19

kPLU_LUT_20 

5-input Look-up Table 20

kPLU_LUT_21 

5-input Look-up Table 21

kPLU_LUT_22 

5-input Look-up Table 22

kPLU_LUT_23 

5-input Look-up Table 23

kPLU_LUT_24 

5-input Look-up Table 24

kPLU_LUT_25 

5-input Look-up Table 25

5 input present for each LUT.

Enumerator
kPLU_LUT_IN_0 

LUT input 0.

kPLU_LUT_IN_1 

LUT input 1.

kPLU_LUT_IN_2 

LUT input 2.

kPLU_LUT_IN_3 

LUT input 3.

kPLU_LUT_IN_4 

LUT input 4.

Enumerator
kPLU_LUT_IN_SRC_PLU_IN_0 

Select PLU input 0 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_PLU_IN_1 

Select PLU input 1 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_PLU_IN_2 

Select PLU input 2 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_PLU_IN_3 

Select PLU input 3 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_PLU_IN_4 

Select PLU input 4 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_PLU_IN_5 

Select PLU input 5 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_0 

Select LUT output 0 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_1 

Select LUT output 1 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_2 

Select LUT output 2 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_3 

Select LUT output 3 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_4 

Select LUT output 4 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_5 

Select LUT output 5 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_6 

Select LUT output 6 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_7 

Select LUT output 7 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_8 

Select LUT output 8 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_9 

Select LUT output 9 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_10 

Select LUT output 10 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_11 

Select LUT output 11 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_12 

Select LUT output 12 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_13 

Select LUT output 13 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_14 

Select LUT output 14 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_15 

Select LUT output 15 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_16 

Select LUT output 16 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_17 

Select LUT output 17 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_18 

Select LUT output 18 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_19 

Select LUT output 19 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_20 

Select LUT output 20 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_21 

Select LUT output 21 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_22 

Select LUT output 22 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_23 

Select LUT output 23 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_24 

Select LUT output 24 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_LUT_OUT_25 

Select LUT output 25 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_FLIPFLOP_0 

Select Flip-Flops state 0 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_FLIPFLOP_1 

Select Flip-Flops state 1 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_FLIPFLOP_2 

Select Flip-Flops state 2 to be connected to LUTn Input x.

kPLU_LUT_IN_SRC_FLIPFLOP_3 

Select Flip-Flops state 3 to be connected to LUTn Input x.

Enumerator
kPLU_OUTPUT_0 

PLU OUTPUT 0.

kPLU_OUTPUT_1 

PLU OUTPUT 1.

kPLU_OUTPUT_2 

PLU OUTPUT 2.

kPLU_OUTPUT_3 

PLU OUTPUT 3.

kPLU_OUTPUT_4 

PLU OUTPUT 4.

kPLU_OUTPUT_5 

PLU OUTPUT 5.

kPLU_OUTPUT_6 

PLU OUTPUT 6.

kPLU_OUTPUT_7 

PLU OUTPUT 7.

Enumerator
kPLU_OUT_SRC_LUT_0 

Select LUT0 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_1 

Select LUT1 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_2 

Select LUT2 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_3 

Select LUT3 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_4 

Select LUT4 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_5 

Select LUT5 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_6 

Select LUT6 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_7 

Select LUT7 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_8 

Select LUT8 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_9 

Select LUT9 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_10 

Select LUT10 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_11 

Select LUT11 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_12 

Select LUT12 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_13 

Select LUT13 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_14 

Select LUT14 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_15 

Select LUT15 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_16 

Select LUT16 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_17 

Select LUT17 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_18 

Select LUT18 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_19 

Select LUT19 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_20 

Select LUT20 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_21 

Select LUT21 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_22 

Select LUT22 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_23 

Select LUT23 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_24 

Select LUT24 output to be connected to PLU output.

kPLU_OUT_SRC_LUT_25 

Select LUT25 output to be connected to PLU output.

kPLU_OUT_SRC_FLIPFLOP_0 

Select Flip-Flops state(0) to be connected to PLU output.

kPLU_OUT_SRC_FLIPFLOP_1 

Select Flip-Flops state(1) to be connected to PLU output.

kPLU_OUT_SRC_FLIPFLOP_2 

Select Flip-Flops state(2) to be connected to PLU output.

kPLU_OUT_SRC_FLIPFLOP_3 

Select Flip-Flops state(3) to be connected to PLU output.

Function Documentation

void PLU_Init ( PLU_Type *  base)
Note
This API should be called at the beginning of the application using the PLU driver.
Parameters
basePLU peripheral base address
void PLU_Deinit ( PLU_Type *  base)
Parameters
basePLU peripheral base address
static void PLU_SetLutInputSource ( PLU_Type *  base,
plu_lut_index_t  lutIndex,
plu_lut_in_index_t  lutInIndex,
plu_lut_input_source_t  inputSrc 
)
inlinestatic

Note: An external clock must be applied to the PLU_CLKIN input when using FFs. For each LUT, the slot associated with the output from LUTn itself is tied low.

Parameters
basePLU peripheral base address.
lutIndexLUT index (see plu_lut_index_t typedef enumeration).
lutInIndexLUT input index (see plu_lut_in_index_t typedef enumeration).
inputSrcLUT input source (see plu_lut_input_source_t typedef enumeration).
static void PLU_SetOutputSource ( PLU_Type *  base,
plu_output_index_t  outputIndex,
plu_output_source_t  outputSrc 
)
inlinestatic

Note: An external clock must be applied to the PLU_CLKIN input when using FFs.

Parameters
basePLU peripheral base address.
outputIndexPLU output index (see plu_output_index_t typedef enumeration).
outputSrcPLU output source (see plu_output_source_t typedef enumeration).
static void PLU_SetLutTruthTable ( PLU_Type *  base,
plu_lut_index_t  lutIndex,
uint32_t  truthTable 
)
inlinestatic
Parameters
basePLU peripheral base address.
lutIndexLUT index (see plu_lut_index_t typedef enumeration).
truthTableTruth Table value.
static uint32_t PLU_ReadOutputState ( PLU_Type *  base)
inlinestatic

Note: The PLU bus clock must be re-enabled prior to reading the Outpus Register if PLU bus clock is shut-off.

Parameters
basePLU peripheral base address.
Returns
Current PLU output state value.