3.6 CLC - Configurable Logic Cell

3.6.1 Introduction

The MPLAB® Code Configurator (MCC) Melody Configurable Logic Cell Peripheral Library (PLIBs) drivers generates APIs to support CLC-specific peripheral functionality on target MCUs.

The Configurable Logic Cell (CLC) module provides programmable logic that operates outside the speed limitations of software execution. The logic cell takes up to 256 input signals and, through the use of configurable gates, reduces those inputs to four logic lines that drive one of eight selectable single-output logic functions.

3.6.2 Supported Device Families

PIC12/16F150xPIC12/16F161xPIC12/16F184x
PIC16F153xxPIC16F170xPIC16F171x
PIC16F171xxPIC16F176x PIC16F177x
PIC16F180xxPIC16F181xxPIC16F183xx
PIC16F184xxPIC16F188xxPIC16F191xx
PIC18F-K42PIC18F-K83PIC18F-Q10
PIC18F-Q20PIC18F-Q24PIC18F-Q40
PIC18F-Q41PIC18F-Q43PIC18F-Q71
PIC18F-Q83PIC18F-Q84

3.6.3 Required header files:

#include "mcc_generated_files/clc/clc[x].h"
Note: Replace [X] with instance number of selected CLC module

3.6.4 Module Documentation

3.6.4.1 CLC1

This file contains the API prototypes for the CLC1 driver.

3.6.4.1.1 Module description

This file contains the API prototypes for the CLC1 driver.

Version: CLC1 Driver Version 1.0.1
Functions
  • void CLCx_Initialize (void)

    Initializes the CLCx. This routine configures the CLC1 specific control registers.

  • void CLCx_Enable (void)

    Enables the CLCx module.  

  • void CLCx_Disable (void)

    Disables the CLCx module.  

  • void CLCx_ISR (void)

    Implements the Interrupt Service Routine (ISR) for the CLC interrupt events.

  • bool CLCx_OutputStatusGet (void)

    Returns the output pin status of the CLC module.

3.6.4.1.2 Function Documentation

CLCx_Disable()

void CLCx_Disable (void )

Disables the CLCx module.  

Parameters:
None.
Returns:

None.

CLCx_Enable()

void CLCx_Enable (void )

Enables the CLCx module.  

Parameters:
None.
Returns:

None.

CLCx_Initialize()

void CLCx_Initialize (void )

Initializes the CLCx. This routine configures the CLC1 specific control registers.

Parameters:
None.
Returns:

None.

CLCx_ISR()

void CLCx_ISR (void )

Implements the Interrupt Service Routine (ISR) for the CLC interrupt events.

Precondition:

CLCx_Initialize() is already called.

Parameters:
None.
Returns:

None.

CLCx_OutputStatusGet()

bool CLCx_OutputStatusGet (void )

Returns the output pin status of the CLC module.

Parameters:
None.
Return values:
True

- Output is 1.

False

- Output is 0.

3.6.5 File Documentation

3.6.5.1 source/clc1.c File Reference

This file contains the API implementations for the CLC1 driver.

#include <xc.h>
#include "../clc(x).h"

3.6.5.1.1 Functions

3.6.5.1.3 Detailed Description

This file contains the API implementations for the CLC1 driver.

CLC1 Generated Driver File.

Version: CLC1 Driver Version 1.0.1

3.6.5.1.4 Function Documentation

CLCx_CLCI_SetInterruptHandler()

void CLCx_CLCI_SetInterruptHandler (void(*)(void) InterruptHandler)

Sets the callback function for the interrupt event.

Parameters:
*InterruptHandler

- Callback function for the interrupt event.

Returns:

None.

CLCx_DefaultCLCI_ISR()

static void CLCx_DefaultCLCI_ISR (void )[static]

3.6.5.1.5 Variable Documentation

CLCx_CLCI_InterruptHandler

void(* CLCx_CLCI_InterruptHandler) (void)[static]

3.6.5.2 source/clc1.h File Reference

#include <xc.h>
#include <stdint.h>
#include <stdbool.h>

3.6.5.2.1 Functions

  • void CLCx_Initialize (void)

    Initializes the CLCx. This routine configures the CLC1 specific control registers.

  • void CLCx_Enable (void)

    Enables the CLCx module.  

  • void CLCx_Disable (void)

    Disables the CLCx module.  

  • void CLCx_ISR (void)

    Implements the Interrupt Service Routine (ISR) for the CLC interrupt events.

  • void CLCx_CLCI_SetInterruptHandler (void(*InterruptHandler)(void))

    Sets the callback function for the interrupt event.

  • bool CLCx_OutputStatusGet (void)

    Returns the output pin status of the CLC module.

3.6.5.2.3 Detailed Description

CLC1 Generated Driver API Header File.

3.6.5.2.4 Function Documentation

CLCx_CLCI_SetInterruptHandler()

void CLCx_CLCI_SetInterruptHandler (void(*)(void) InterruptHandler)

Sets the callback function for the interrupt event.

Parameters:
*InterruptHandler

- Callback function for the interrupt event.

Returns:

None.

3.6.5.2.5 Macro Definition Documentation

CLCx_CLCI_SetInterruptHandler

#define CLCx_CLCI_SetInterruptHandler CLCx_CLCI_SetInterruptHandler

CLCx_Disable

#define CLCx_Disable CLCx_Disable

CLCx_Enable

#define CLCx_Enable CLCx_Enable

CLCx_Initialize

#define CLCx_Initialize CLCx_Initialize

CLCx_ISR

#define CLCx_ISR CLCx_ISR

CLCx_OutputStatusGet

#define CLCx_OutputStatusGet CLCx_OutputStatusGet