This driver for Atmel® | SMART ARM®-based microcontrollers provides an interface for the configuration and management of the device's Configurable Custom Logic functionality.
The following peripheral is used by this module:
The following devices can use this module:
The outline of this documentation is as follows:
There are no prerequisites for this module.
This driver provides an interface for the Configurable Custom Logic functions on the device.
The Configurable Custom Logic (CCL) contains programmable logic which can be connected to the device pins, events, or internal peripherals.
Each LUT consists of three inputs, a truth table and optional synchronizer, filter and edge detector. Each LUT can generate an output as a user programmable logic expression with three inputs.
The output can be combinatorially generated from the inputs, or filtered to remove spike. An optional sequential module can be enabled. The inputs of sequential module are individually controlled by two independent, adjacent LUT(LUT0/LUT1, LUT2/LUT3 etc.) outputs, enabling complex waveform generation.
There are no special considerations for this module.
For extra information, see Extra Information for CCL Driver. This includes:
For a list of examples related to this driver, see Examples for CCL Driver.
Data Structures | |
struct | ccl_config |
CCL module configuration structure. More... | |
struct | ccl_lut_config |
CCL LUT 0 to 3 configuration structure. More... | |
Enumerations | |
enum | ccl_lut_filter_sel { CCL_LUT_FILTER_DISABLE = CCL_LUTCTRL_FILTSEL_DISABLE, CCL_LUT_FILTER_SYNC = CCL_LUTCTRL_FILTSEL_SYNCH, CCL_LUT_FILTER_ENABLE = CCL_LUTCTRL_FILTSEL_FILTER } |
Select the LUT output filter options enum. More... | |
enum | ccl_lut_id { CCL_LUT_0 = 0, CCL_LUT_1 = 1, CCL_LUT_2 = 2, CCL_LUT_3 = 3 } |
CCL LUT(look up table) ID number enum. More... | |
enum | ccl_lut_input_src_sel { CCL_LUT_INPUT_SRC_MASK = 0, CCL_LUT_INPUT_SRC_FEEDBACK = 1, CCL_LUT_INPUT_SRC_LINK = 2, CCL_LUT_INPUT_SRC_EVENT = 3, CCL_LUT_INPUT_SRC_IO = 4, CCL_LUT_INPUT_SRC_AC = 5, CCL_LUT_INPUT_SRC_TC = 6, CCL_LUT_INPUT_SRC_ALTTC = 7, CCL_LUT_INPUT_SRC_TCC = 8, CCL_LUT_INPUT_SRC_SERCOM = 9 } |
LUT Input source selection configuration enum. More... | |
enum | ccl_seq_id { CCL_SEQ_0 = 0, CCL_SEQ_1 = 1 } |
CCL sequential module ID number enum. More... | |
enum | ccl_seq_selection { CCL_SEQ_DISABLED = CCL_SEQCTRL_SEQSEL_DISABLE, CCL_SEQ_D_FLIP_FLOP = CCL_SEQCTRL_SEQSEL_DFF, CCL_SEQ_JK_FLIP_FLOP = CCL_SEQCTRL_SEQSEL_JK, CCL_SEQ_D_LATCH = CCL_SEQCTRL_SEQSEL_LATCH, CCL_SEQ_RS_LATCH = CCL_SEQCTRL_SEQSEL_RS } |
Sequential selection enum. More... | |
Initialize and Reset CCL Module | |
void | ccl_init (struct ccl_config *const config) |
Initializes CCL module. More... | |
static void | ccl_get_config_defaults (struct ccl_config *const config) |
Initializes all members of a CCL configuration structure to safe defaults. More... | |
static void | ccl_module_reset (void) |
Resets CCL module. More... | |
Enable and Disable CCL Module | |
static void | ccl_module_enable (void) |
Enables CCL module. More... | |
static void | ccl_module_disable (void) |
Disables CCL module. More... | |
Configure LUT | |
enum status_code | ccl_seq_config (const enum ccl_seq_id number, const enum ccl_seq_selection seq_selection) |
Writes sequential selection to the hardware module. More... | |
void | ccl_lut_get_config_defaults (struct ccl_lut_config *const config) |
Initializes all members of LUT configuration structure to safe defaults. More... | |
enum status_code | ccl_lut_set_config (const enum ccl_lut_id number, struct ccl_lut_config *const config) |
Writes LUT configuration to the hardware module. More... | |
Enable and Disable LUT | |
void | ccl_lut_enable (const enum ccl_lut_id number) |
Enables an LUT that was previously configured. More... | |
void | ccl_lut_disable (const enum ccl_lut_id number) |
Disables an LUT that was previously enabled. More... | |
enum ccl_lut_filter_sel |
enum ccl_lut_id |
LUT Input source selection configuration enum.
Enum for the LUT Input source selection.
enum ccl_seq_id |
enum ccl_seq_selection |
|
inlinestatic |
Initializes all members of a CCL configuration structure to safe defaults.
Initializes all members of a given Configurable Custom Logic configuration structure to safe and known default values. This function should be called on all new instances of these configuration structures before being modified by the user application.
The default configuration is as follows:
[out] | config | Configuration structure to initialize to default values |
References Assert, ccl_config::clock_source, GCLK_GENERATOR_0, and ccl_config::run_in_standby.
void ccl_init | ( | struct ccl_config *const | config | ) |
Initializes CCL module.
Resets all registers in the MODULE to their initial state, and then enable the module.
References ccl_module_reset(), ccl_config::clock_source, ccl_config::run_in_standby, system_gclk_chan_config::source_generator, system_apb_clock_set_mask(), SYSTEM_CLOCK_APB_APBC, SYSTEM_CLOCK_APB_APBD, system_gclk_chan_enable(), system_gclk_chan_get_config_defaults(), and system_gclk_chan_set_config().
void ccl_lut_disable | ( | const enum ccl_lut_id | number | ) |
Disables an LUT that was previously enabled.
Disables an LUT that was previously enabled via a call to ccl_lut_enable().
[in] | number | LUT number to enable |
void ccl_lut_enable | ( | const enum ccl_lut_id | number | ) |
Enables an LUT that was previously configured.
Enables an LUT that was previously configured via a call to ccl_lut_set_config function.
[in] | number | LUT number to enable |
void ccl_lut_get_config_defaults | ( | struct ccl_lut_config *const | config | ) |
Initializes all members of LUT configuration structure to safe defaults.
Initializes all members of LUT configuration structure to safe defaults. This function should be called on all new instances of these configuration structures before being modified by the user application.
The default configuration is as follows:
[out] | config | LUT configuration structure to initialize to default values |
References Assert, CCL_LUT_FILTER_DISABLE, CCL_LUT_INPUT_SRC_MASK, ccl_lut_config::edge_selection_enable, ccl_lut_config::event_input_enable, ccl_lut_config::event_input_inverted_enable, ccl_lut_config::event_output_enable, ccl_lut_config::filter_sel, ccl_lut_config::input0_src_sel, ccl_lut_config::input1_src_sel, ccl_lut_config::input2_src_sel, and ccl_lut_config::truth_table_value.
enum status_code ccl_lut_set_config | ( | const enum ccl_lut_id | number, |
struct ccl_lut_config *const | config | ||
) |
Writes LUT configuration to the hardware module.
Writes a given LUT configuration to the hardware module.
[in] | config | Pointer to the LUT configuration struct |
[in] | number | LUT number to config |
References Assert, ccl_lut_config::edge_selection_enable, ccl_lut_config::event_input_enable, ccl_lut_config::event_input_inverted_enable, ccl_lut_config::event_output_enable, ccl_lut_config::filter_sel, ccl_lut_config::input0_src_sel, ccl_lut_config::input1_src_sel, ccl_lut_config::input2_src_sel, STATUS_BUSY, STATUS_OK, and ccl_lut_config::truth_table_value.
|
inlinestatic |
Disables CCL module.
Disables the peripheral.
|
inlinestatic |
Enables CCL module.
Enable the peripheral.
|
inlinestatic |
Resets CCL module.
Resets all registers in the MODULE to their initial state, and the CCL will be disabled.
Referenced by ccl_init().
enum status_code ccl_seq_config | ( | const enum ccl_seq_id | number, |
const enum ccl_seq_selection | seq_selection | ||
) |
Writes sequential selection to the hardware module.
Writes a given sequential selection configuration to the hardware module.
[in] | seq_selection | Enum for the sequential selection configuration |
[in] | number | SEQ unit number to config |
References STATUS_BUSY, and STATUS_OK.