![]() |
MCUXpresso SDK API Reference Manual
Rev 2.13.0
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the Programmable Logic Unit module of MCUXpresso SDK devices.
The PLU driver supports the creation of small combinatorial and/or sequential logic networks including simple state machines.
The function PLU_Init() enables the PLU clock and reset the module.
The function PIT_Deinit() gates the PLU clock.
The function PLU_SetLutInputSource() sets the input source for the LUT element.
The function PLU_SetOutputSource() sets output source of the PLU module.
The function PLU_SetLutTruthTable() sets the truth table for the LUT element.
The function PLU_ReadOutputState() reads the current state of the 8 designated PLU Outputs.
The function PLU_EnableWakeIntRequest() enables the wake-up/interrupt request on a PLU output pin with a optional configuration to eliminate the glitches. The function PLU_GetDefaultWakeIntConfig() gets the default configuration which can be used in a case with a given PLU_CLKIN.
The function PLU_LatchInterrupt() latches the interrupt and it can be cleared by function PLU_ClearLatchedInterrupt().
Create a simple combinatorial logic network to control the LED. Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/plu/combination
Data Structures | |
struct | plu_wakeint_config_t |
Wake configuration. More... | |
Driver version | |
#define | FSL_PLU_DRIVER_VERSION (MAKE_VERSION(2, 2, 1)) |
Version 2.2.1. | |
Initialization and deinitialization | |
void | PLU_Init (PLU_Type *base) |
Enable 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... | |
Wake-up/Interrupt Control | |
void | PLU_GetDefaultWakeIntConfig (plu_wakeint_config_t *config) |
Gets an available pre-defined settings for wakeup/interrupt control. More... | |
void | PLU_EnableWakeIntRequest (PLU_Type *base, uint32_t interruptMask, const plu_wakeint_config_t *config) |
Enable PLU outputs wakeup/interrupt request. More... | |
static void | PLU_LatchInterrupt (PLU_Type *base) |
Latch an interrupt. More... | |
void | PLU_ClearLatchedInterrupt (PLU_Type *base) |
Clear the latched interrupt. More... | |
struct plu_wakeint_config_t |
Data Fields | |
plu_wakeint_filter_mode_t | filterMode |
Filter Mode. More... | |
plu_wakeint_filter_clock_source_t | clockSource |
The clock source for filter mode. More... | |
plu_wakeint_filter_mode_t plu_wakeint_config_t::filterMode |
plu_wakeint_filter_clock_source_t plu_wakeint_config_t::clockSource |
enum plu_lut_index_t |
enum plu_lut_in_index_t |
enum plu_output_index_t |
enum plu_output_source_t |
enum _plu_interrupt_mask |
void PLU_Init | ( | PLU_Type * | base | ) |
base | PLU peripheral base address |
void PLU_Deinit | ( | PLU_Type * | base | ) |
base | PLU peripheral base address |
|
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.
base | PLU peripheral base address. |
lutIndex | LUT index (see plu_lut_index_t typedef enumeration). |
lutInIndex | LUT input index (see plu_lut_in_index_t typedef enumeration). |
inputSrc | LUT input source (see plu_lut_input_source_t typedef enumeration). |
|
inlinestatic |
Note: An external clock must be applied to the PLU_CLKIN input when using FFs.
base | PLU peripheral base address. |
outputIndex | PLU output index (see plu_output_index_t typedef enumeration). |
outputSrc | PLU output source (see plu_output_source_t typedef enumeration). |
|
inlinestatic |
base | PLU peripheral base address. |
lutIndex | LUT index (see plu_lut_index_t typedef enumeration). |
truthTable | Truth Table value. |
|
inlinestatic |
Note: The PLU bus clock must be re-enabled prior to reading the Outpus Register if PLU bus clock is shut-off.
base | PLU peripheral base address. |
void PLU_GetDefaultWakeIntConfig | ( | plu_wakeint_config_t * | config | ) |
This function initializes the initial configuration structure with an available settings. The default values are:
config | Pointer to configuration structure. |
void PLU_EnableWakeIntRequest | ( | PLU_Type * | base, |
uint32_t | interruptMask, | ||
const plu_wakeint_config_t * | config | ||
) |
This function enables Any of the eight selected PLU outputs to contribute to an asynchronous wake-up or an interrupt request.
Note: If a PLU_CLKIN is provided, the raw wake-up/interrupt request will be set on the rising-edge of the PLU_CLKIN whenever the raw request signal is high. This registered signal will be glitch-free and just use the default wakeint config by PLU_GetDefaultWakeIntConfig(). If not, have to specify the filter mode and clock source to eliminate the glitches caused by long and widely disparate delays through the network of LUTs making up the PLU. This way may increase power consumption in low-power operating modes and inject delay before the wake-up/interrupt request is generated.
base | PLU peripheral base address. |
interruptMask | PLU interrupt mask (see _plu_interrupt_mask enumeration). |
config | Pointer to configuration structure (see plu_wakeint_config_t typedef enumeration) |
|
inlinestatic |
This function latches the interrupt and then it can be cleared with PLU_ClearLatchedInterrupt().
Note: This mode is not compatible with use of the glitch filter. If this bit is set, the FILTER MODE should be set to kPLU_WAKEINT_FILTER_MODE_BYPASS (Bypass Mode) and PLU_CLKIN should be provided. If this bit is set, the wake-up/interrupt request will be set on the rising-edge of PLU_CLKIN whenever the raw wake-up/interrupt signal is high. The request must be cleared by software.
base | PLU peripheral base address. |
void PLU_ClearLatchedInterrupt | ( | PLU_Type * | base | ) |
This function clears the wake-up/interrupt request flag latched by PLU_LatchInterrupt()
Note: It is not necessary for the PLU bus clock to be enabled in order to write-to or read-back this bit.
base | PLU peripheral base address. |