CMSIS-Driver_PIC32CM-PL  
Peripheral Library (PLIB) Documentation
 
Loading...
Searching...
No Matches
CCL Interface

Driver API for CCL (plib_ccl.h) More...

Functions

void CCL_Enable (void)
 Enables the CCL module.
 
void CCL_Disable (void)
 Disables the CCL module.
 
void CCL_SoftwareReset (void)
 Performs a software reset of the CCL module.
 
void CCL_RunInStandby (bool run_standby)
 Configures the CCL to run in standby mode.
 
void CCL_SetLUTTruthTable (uint8_t lut_index, uint8_t truth_value)
 Sets the truth table for a specified LUT.
 
void CCL_SetLUTInputs (uint8_t lut_index, uint8_t in0, uint8_t in1, uint8_t in2)
 Sets the input sources for a specified LUT.
 
void CCL_SetLUTFilter (uint8_t lut_index, uint8_t filter)
 Sets the filter for a specified LUT.
 
void CCL_SetLUTEdgeDetect (uint8_t lut_index, uint8_t edge)
 Sets the edge detection for a specified LUT.
 
void CCL_EnableLUTOutput (uint8_t lut_index, bool enable)
 Enables or disables the output for a specified LUT.
 
void CCL_SetLUTInvert (uint8_t lut_index, bool invert)
 Sets the output inversion for a specified LUT.
 
void CCL_EnableLUTInput (uint8_t lut_index, bool input_enable)
 Enables or disables the input for a specified LUT.
 
void CCL_ConfigureSequencer (uint8_t seq_index, uint8_t seq_type)
 Configures the sequencer for a specified index.
 
void CCL_EnableWriteProtection (void)
 Enables write protection for CCL registers.
 
void CCL_DisableWriteProtection (void)
 Disables write protection for CCL registers.
 
void CCL_WriteProtectionLock (void)
 Locks write protection configuration until reset.
 
bool CCL_WriteProtectionIsEnabled (void)
 Queries if write protection is enabled.
 
bool CCL_WriteProtectionIsLocked (void)
 Queries if write protection is locked.
 

Description

Driver API for CCL (plib_ccl.h)

Usage Example

The following example demonstrates typical usage of the CCL peripheral:

#include "plib_ccl.h"
#include <stdint.h>
#include <stdbool.h>
/* Internal configuration function */
int configure_ccl(void)
{
/* Disable write protection to allow CCL configuration */
/* Disable CCL before making configuration changes */
/* Configure LUT2 as a 3-input AND gate */
CCL_LUTCTRL_INSEL0_IO_Val,
CCL_LUTCTRL_INSEL0_IO_Val,
CCL_LUTCTRL_INSEL0_IO_Val);
/* Disable LUT filter */
CCL_SetLUTFilter(2, CCL_LUTCTRL_FILTSEL_DISABLE_Val);
/* Disable LUT input */
CCL_EnableLUTInput(2, false);
/* Enable LUT output */
/* Truth table for 3-input AND gate */
/* Disable sequencer 1 */
CCL_ConfigureSequencer(1, CCL_SEQCTRL_SEQSEL1_DISABLE_Val);
/* Disable run in standby mode */
/* Enable CCL module */
/* Re-enable and lock write protection */
return 0;
}
void CCL_WriteProtectionLock(void)
Locks write protection configuration until reset.
void CCL_Disable(void)
Disables the CCL module.
void CCL_ConfigureSequencer(uint8_t seq_index, uint8_t seq_type)
Configures the sequencer for a specified index.
void CCL_EnableWriteProtection(void)
Enables write protection for CCL registers.
void CCL_SetLUTInputs(uint8_t lut_index, uint8_t in0, uint8_t in1, uint8_t in2)
Sets the input sources for a specified LUT.
void CCL_EnableLUTOutput(uint8_t lut_index, bool enable)
Enables or disables the output for a specified LUT.
void CCL_DisableWriteProtection(void)
Disables write protection for CCL registers.
void CCL_EnableLUTInput(uint8_t lut_index, bool input_enable)
Enables or disables the input for a specified LUT.
void CCL_SetLUTTruthTable(uint8_t lut_index, uint8_t truth_value)
Sets the truth table for a specified LUT.
void CCL_SetLUTFilter(uint8_t lut_index, uint8_t filter)
Sets the filter for a specified LUT.
void CCL_Enable(void)
Enables the CCL module.
void CCL_RunInStandby(bool run_standby)
Configures the CCL to run in standby mode.
Configurable Custom Logic (CCL) Peripheral Library Interface.

Function Documentation

◆ CCL_ConfigureSequencer()

void CCL_ConfigureSequencer ( uint8_t seq_index,
uint8_t seq_type )

Configures the sequencer for a specified index.

Parameters
seq_indexIndex of the sequencer to configure.
seq_typeSequencer type selection value.
Returns
None.

◆ CCL_Disable()

void CCL_Disable ( void )

Disables the CCL module.

Parameters
None.
Returns
None.

◆ CCL_DisableWriteProtection()

void CCL_DisableWriteProtection ( void )

Disables write protection for CCL registers.

Parameters
None.
Returns
None.

◆ CCL_Enable()

void CCL_Enable ( void )

Enables the CCL module.

Parameters
None.
Returns
None.

◆ CCL_EnableLUTInput()

void CCL_EnableLUTInput ( uint8_t lut_index,
bool input_enable )

Enables or disables the input for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
input_enableSet to true to enable input, false to disable.
Returns
None.

◆ CCL_EnableLUTOutput()

void CCL_EnableLUTOutput ( uint8_t lut_index,
bool enable )

Enables or disables the output for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
enableSet to true to enable output, false to disable.
Returns
None.

◆ CCL_EnableWriteProtection()

void CCL_EnableWriteProtection ( void )

Enables write protection for CCL registers.

Parameters
None.
Returns
None.

◆ CCL_RunInStandby()

void CCL_RunInStandby ( bool run_standby)

Configures the CCL to run in standby mode.

Parameters
run_standbySet to true to enable run in standby, false to disable.
Returns
None.

◆ CCL_SetLUTEdgeDetect()

void CCL_SetLUTEdgeDetect ( uint8_t lut_index,
uint8_t edge )

Sets the edge detection for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
edgeEdge detection selection value.
Returns
None.

◆ CCL_SetLUTFilter()

void CCL_SetLUTFilter ( uint8_t lut_index,
uint8_t filter )

Sets the filter for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
filterFilter selection value.
Returns
None.

◆ CCL_SetLUTInputs()

void CCL_SetLUTInputs ( uint8_t lut_index,
uint8_t in0,
uint8_t in1,
uint8_t in2 )

Sets the input sources for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
in0Input 0 source selection.
in1Input 1 source selection.
in2Input 2 source selection.
Returns
None.

◆ CCL_SetLUTInvert()

void CCL_SetLUTInvert ( uint8_t lut_index,
bool invert )

Sets the output inversion for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
invertSet to true to invert output, false for normal output.
Returns
None.

◆ CCL_SetLUTTruthTable()

void CCL_SetLUTTruthTable ( uint8_t lut_index,
uint8_t truth_value )

Sets the truth table for a specified LUT.

Parameters
lut_indexIndex of the LUT to configure.
truth_value8-bit truth table value.
Returns
None.

◆ CCL_SoftwareReset()

void CCL_SoftwareReset ( void )

Performs a software reset of the CCL module.

Parameters
None.
Returns
None.

◆ CCL_WriteProtectionIsEnabled()

bool CCL_WriteProtectionIsEnabled ( void )

Queries if write protection is enabled.

Parameters
None.
Returns
true if enabled, false otherwise.

◆ CCL_WriteProtectionIsLocked()

bool CCL_WriteProtectionIsLocked ( void )

Queries if write protection is locked.

Parameters
None.
Returns
true if locked, false otherwise.

◆ CCL_WriteProtectionLock()

void CCL_WriteProtectionLock ( void )

Locks write protection configuration until reset.

Parameters
None.
Returns
None.