2.5 CLC Driver
2.5.1 Introduction
Overview
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. This provides greater flexibility and potential in embedded designs, since the CLC module can operate outside the limitations of software execution, and supports a vast amount of output designs.
Features
- The driver provides a CLC GUI whose gates can be configured depending on the application needs.
- The mode of the CLC can be configured using the Logic Cell Mode component in the software settings tab.
- AND-OR,
- OR-XOR,
- 4-input AND,
- SR latch,
- 1-input D flip-flop with S and R,
- 2-input D flip-flop with R,
- JK flip-flop with R,
- 1-input transparent latch with S and R
2.5.2 Module Documentation
2.5.2.1 CLC Driver
Configurable Logic Cell driver 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 using dsPIC MCUs.
2.5.2.1.1 Module description
Configurable Logic Cell driver 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 using dsPIC MCUs.
2.5.2.1.1.1 Data structures
struct CLC_INTERFACE
Structure containing the function pointers of CLC driver.
2.5.2.1.1.2 Functions
void CLC1_Initialize (void)
Initializes the CLC1 module.
void CLC1_Deinitialize (void)
Deinitializes the CLC1 to POR values.
bool CLC1_OutputStatusGet (void)
Returns output pin status of the CLC1 module.
static void CLC1_Enable (void)
This inline function enables the CLC1 module.
static void CLC1_Disable (void)
This inline function disables the CLC1 module.
void CLC1_PositiveEdgeCallbackRegister (void(*handler)(void))
This function can be used to override default callback and to define custom callback for CLC1 PositiveEdge event.
void CLC1_PositiveEdgeCallback (void)
This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CLC1_PositiveEdgeCallbackRegister.
void CLC1_NegativeEdgeCallbackRegister (void(*handler)(void))
This function can be used to override default callback and to define custom callback for CLC1 NegativeEdge event.
void CLC1_NegativeEdgeCallback (void)
This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CLC1_NegativeEdgeCallbackRegister.
void CLC1_Tasks (void)
Implements the tasks for polled implementations where the hardware supports dedicated event for Positive edge, Negative edge or both. Note: If both Positive Edge and Negative Edge uses polling mode then Callback function of positive edge takes the priority if both event occurred.
2.5.2.1.1.3 Variables
const struct CLC_INTERFACE CLC1
Structure object of type CLC_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.5.2.1.2 Function Documentation
2.5.2.1.2.1 CLC1_Deinitialize()
void CLC1_Deinitialize (void )
Deinitializes the CLC1 to POR values.
none |
none |
2.5.2.1.2.2 CLC1_Disable()
inline static void CLC1_Disable (void )
This inline function disables the CLC1 module.
CLC1_Initialize function should be called before calling this function. |
none |
none |
2.5.2.1.2.3 CLC1_Enable()
inline static void CLC1_Enable (void )
This inline function enables the CLC1 module.
CLC1_Initialize function should be called before calling this function. |
none |
none |
2.5.2.1.2.4 CLC1_Initialize()
void CLC1_Initialize (void )
Initializes the CLC1 module.
none |
none |
2.5.2.1.2.5 CLC1_NegativeEdgeCallback()
void CLC1_NegativeEdgeCallback (void )
This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CLC1_NegativeEdgeCallbackRegister.
none |
none |
2.5.2.1.2.6 CLC1_NegativeEdgeCallbackRegister()
void CLC1_NegativeEdgeCallbackRegister (void(*)(void) handler)
This function can be used to override default callback and to define custom callback for CLC1 NegativeEdge event.
in | handler |
- Address of the callback function. |
none |
2.5.2.1.2.7 CLC1_OutputStatusGet()
bool CLC1_OutputStatusGet (void )
Returns output pin status of the CLC1 module.
CLC1_Initialize function should be called before calling this function. |
none |
Output pin status |
2.5.2.1.2.8 CLC1_PositiveEdgeCallback()
void CLC1_PositiveEdgeCallback (void )
This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CLC1_PositiveEdgeCallbackRegister.
none |
none |
2.5.2.1.2.9 CLC1_PositiveEdgeCallbackRegister()
void CLC1_PositiveEdgeCallbackRegister (void(*)(void) handler)
This function can be used to override default callback and to define custom callback for CLC1 PositiveEdge event.
in | handler |
- Address of the callback function. |
none |
2.5.2.1.2.10 CLC1_Tasks()
void CLC1_Tasks (void )
Implements the tasks for polled implementations where the hardware supports dedicated event for Positive edge, Negative edge or both. Note: If both Positive Edge and Negative Edge uses polling mode then Callback function of positive edge takes the priority if both event occurred.
CLC1_Initialize function should be called before calling this function. |
none |
none |
2.5.2.1.3 Variable Documentation
2.5.2.1.3.1 CLC1
const struct CLC_INTERFACE CLC1
Structure object of type CLC_INTERFACE with the custom name given by the user in the Melody Driver User interface.
The default name e.g. CLC1 can be changed by the user in the CLC user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
2.5.3 Class Documentation
2.5.3.1 CLC_INTERFACE Struct Reference
Structure containing the function pointers of CLC driver.
2.5.3.1.1 Detailed Description
Structure containing the function pointers of CLC driver.
#include <clc_interface.h>
2.5.3.1.1.1 Public Attributes
void(* Initialize )(void)
Pointer to CLCx_Initialize e.g. CLC1_Initialize.
void(* Deinitialize )(void)
Pointer to CLCx_Deinitialize e.g. CLC1_Deinitialize.
void(* Enable )(void)
Pointer to CLCx_Enable e.g. CLC1_Enable.
void(* Disable )(void)
Pointer to CLCx_Disable e.g. CLC1_Disable.
bool(* OutputStatusGet )(void)
Pointer to CLCx_OutputStatusGet e.g. CLC1_OutputStatusGet.
void(* EdgeCallbackRegister )(void(*CallbackHandler)(void))
Pointer to CLCx_EdgeCallbackRegister e.g. CLC1_EdgeCallbackRegister.
void(* PositiveEdgeCallbackRegister )(void(*CallbackHandler)(void))
Pointer to CLCx_PositiveEdgeCallbackRegister e.g. CLC1_PositiveEdgeCallbackRegister.
void(* NegativeEdgeCallbackRegister )(void(*CallbackHandler)(void))
Pointer to CLCx_NegativeEdgeCallbackRegister e.g. CLC1_NegativeEdgeCallbackRegister.
void(* Tasks )(void)
Pointer to CLCx_Tasks e.g. CLC1_Tasks (Supported only in polling mode)
2.5.3.1.2 Member Data Documentation
2.5.3.1.2.1 Deinitialize
void(* Deinitialize) (void)
Pointer to CLCx_Deinitialize e.g. CLC1_Deinitialize.
2.5.3.1.2.2 Disable
void(* Disable) (void)
Pointer to CLCx_Disable e.g. CLC1_Disable.
2.5.3.1.2.3 EdgeCallbackRegister
void(* EdgeCallbackRegister) (void(*CallbackHandler)(void))
Pointer to CLCx_EdgeCallbackRegister e.g. CLC1_EdgeCallbackRegister.
2.5.3.1.2.4 Enable
void(* Enable) (void)
Pointer to CLCx_Enable e.g. CLC1_Enable.
2.5.3.1.2.5 Initialize
void(* Initialize) (void)
Pointer to CLCx_Initialize e.g. CLC1_Initialize.
2.5.3.1.2.6 NegativeEdgeCallbackRegister
void(* NegativeEdgeCallbackRegister) (void(*CallbackHandler)(void))
Pointer to CLCx_NegativeEdgeCallbackRegister e.g. CLC1_NegativeEdgeCallbackRegister.
2.5.3.1.2.7 OutputStatusGet
bool(* OutputStatusGet) (void)
Pointer to CLCx_OutputStatusGet e.g. CLC1_OutputStatusGet.
2.5.3.1.2.8 PositiveEdgeCallbackRegister
void(* PositiveEdgeCallbackRegister) (void(*CallbackHandler)(void))
Pointer to CLCx_PositiveEdgeCallbackRegister e.g. CLC1_PositiveEdgeCallbackRegister.
2.5.3.1.2.9 Tasks
void(* Tasks) (void)
Pointer to CLCx_Tasks e.g. CLC1_Tasks (Supported only in polling mode)
2.5.4 File Documentation
2.5.4.1 source/clc1.h File Reference
This is the generated driver header file for the CLC1 driver.
#include <xc.h> #include <stdint.h> #include <stdbool.h> #include "clc_interface.h"
2.5.4.1.1 Functions
void CLC1_Initialize (void)
Initializes the CLC1 module.
void CLC1_Deinitialize (void)
Deinitializes the CLC1 to POR values.
bool CLC1_OutputStatusGet (void)
Returns output pin status of the CLC1 module.
static void CLC1_Enable (void)
This inline function enables the CLC1 module.
static void CLC1_Disable (void)
This inline function disables the CLC1 module.
void CLC1_PositiveEdgeCallbackRegister (void(*handler)(void))
This function can be used to override default callback and to define custom callback for CLC1 PositiveEdge event.
void CLC1_PositiveEdgeCallback (void)
This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CLC1_PositiveEdgeCallbackRegister.
void CLC1_NegativeEdgeCallbackRegister (void(*handler)(void))
This function can be used to override default callback and to define custom callback for CLC1 NegativeEdge event.
void CLC1_NegativeEdgeCallback (void)
This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using CLC1_NegativeEdgeCallbackRegister.
void CLC1_Tasks (void)
Implements the tasks for polled implementations where the hardware supports dedicated event for Positive edge, Negative edge or both. Note: If both Positive Edge and Negative Edge uses polling mode then Callback function of positive edge takes the priority if both event occurred.
2.5.4.1.2 Variables
const struct CLC_INTERFACE CLC1
Structure object of type CLC_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.5.4.1.3 Detailed Description
This is the generated driver header file for the CLC1 driver.
CLC1 Generated Driver Header File
2.5.4.2 source/clc_interface.h File Reference
2.5.4.2.1 Data structures
struct CLC_INTERFACE
Structure containing the function pointers of CLC driver.
2.5.4.2.2 Detailed Description
CLC Generated Driver Interface Header File