In this use case, the LUT0 and LUT1 input source is configured as I/O pin.
The LUT0 and LUT1 pair is connected to internal sequential logic, which is configured as D flip flop mode.
Setup
Prerequisites
There are no special setup requirements for this use-case.
Code
Copy-paste the following setup code to your user application:
{
}
{
conf.truth_table_value = 0x02;
conf.filter_sel = CCL_LUTCTRL_FILTSEL_FILTER;
lut0_input_pin0_conf.mux_position = CCL_LUT0_IN0_MUX;
lut0_input_pin1_conf.mux_position = CCL_LUT0_IN1_MUX;
lut0_input_pin2_conf.mux_position = CCL_LUT0_IN2_MUX;
lut0_out_pin_conf.mux_position = CCL_LUT0_OUT_MUX;
}
{
conf.truth_table_value = 0x02;
conf.filter_sel = CCL_LUTCTRL_FILTSEL_FILTER;
lut1_input_pin0_conf.mux_position = CCL_LUT1_IN0_MUX;
lut1_input_pin1_conf.mux_position = CCL_LUT1_IN1_MUX;
lut1_input_pin2_conf.mux_position = CCL_LUT1_IN2_MUX;
lut1_out_pin_conf.mux_position = CCL_LUT1_OUT_MUX;
}
Add to user application initialization (typically the start of main()
):
Workflow
- Creates a CCL configuration struct, which can be filled out to adjust the configuration of CCL.
- Settings and fill the CCL configuration struct with the default settings.
- Initializes CCL module.
- Creates a LUT configuration struct, which can be filled out to adjust the configuration of LUT0.
- Fill the LUT0 configuration struct with the default settings.
- Adjust the LUT0 configuration struct.
conf.truth_table_value = 0x02;
conf.filter_sel = CCL_LUTCTRL_FILTSEL_FILTER;
- Set up LUT0 input and output pin.
lut0_input_pin0_conf.mux_position = CCL_LUT0_IN0_MUX;
lut0_input_pin1_conf.mux_position = CCL_LUT0_IN1_MUX;
lut0_input_pin2_conf.mux_position = CCL_LUT0_IN2_MUX;
lut0_out_pin_conf.mux_position = CCL_LUT0_OUT_MUX;
- Writes LUT0 configuration to the hardware module.
- Creates a LUT configuration struct, which can be filled out to adjust the configuration of LUT1.
- Fill the LUT1 configuration struct with the default settings.
- Adjust the LUT1 configuration struct.
conf.truth_table_value = 0x02;
conf.filter_sel = CCL_LUTCTRL_FILTSEL_FILTER;
- Set up LUT1 input and output pin.
lut1_input_pin0_conf.mux_position = CCL_LUT1_IN0_MUX;
lut1_input_pin1_conf.mux_position = CCL_LUT1_IN1_MUX;
lut1_input_pin2_conf.mux_position = CCL_LUT1_IN2_MUX;
lut1_out_pin_conf.mux_position = CCL_LUT1_OUT_MUX;
- Writes LUT1 configuration to the hardware module.
- Configure the sequential logic with the D flip flop mode.
Use Case
Code
Copy-paste the following code to your user application: