2.13 Configurable Logic Cell (CLC)

The Configurable Logic Cell (CLC) module allows the user to specify combinations of signals as inputs to a logic function and to use the logic output to control other peripherals or I/O pins. CLC module can also be configured to generate and interrupt when the logic cell output changes.

Using The Library

CLC peripheral runs independent of the processor core. CLC peripheral is initialized using CLC_Initialize() API. This will be done by the auto-generated code as part of the system initialization (that is, if CLC peripheral is added to the project graph).

At any point during program execution, logic cell can be turned On or Off using CLC_Enable API. Invoking CLC_Enable() with argument value of "true" will enable the logic cell and an argument value of "false" will disable it.

If CLC is configured to generate a processor Interrupt, a callback must be registered using the CLC_CallbackRegister() API. See code example below.

/* Context is provided as part of callback */
void CLC_EventHandler(uintptr_t context)
{
    /* CLC interrupt occurred, do something */
}

int main(void)
{
    /* Register Callback */
    CLC1_CallbackRegister(CLC_EventHandler, (uintptr_t) NULL);

    /* Enable CLC */
    CLC1_Enable(true);
}

Library Interface

Configurable Logic Cell peripheral library provides the following interfaces:

Functions

NameDescription
CLCx_InitializeInitializes CLC peripheral
CLCx_EnableEnable/Disable CLC module
CLCx_CallbackRegisterRegisters the function to be called from interrupt

Data types and constants

NameTypeDescription
CLC_CALLBACKTypedefDefines the data type and function signature for the CLC peripheral callback function
Note: Not all APIs maybe implemented. See the specific device family section for available APIs.