5.8.1.1.3 Workflow

  1. Creates a CCL configuration struct, which can be filled out to adjust the configuration of CCL.
    struct ccl_config conf;
    
  2. Settings and fill the CCL configuration struct with the default settings.
    ccl_get_config_defaults(&conf);
    
  3. Initializes CCL module.
    ccl_init(&conf);
    
  4. Creates a LUT configuration struct, which can be filled out to adjust the configuration of LUT0.
    struct ccl_lut_config conf;
    
    1. Fill the LUT0 configuration struct with the default settings.
      ccl_lut_get_config_defaults(&conf);
      
  5. Adjust the LUT0 configuration struct.
    conf.truth_table_value = 0x02;
    conf.input0_src_sel = CCL_LUT_INPUT_SRC_IO;
    conf.input1_src_sel = CCL_LUT_INPUT_SRC_IO;
    conf.input2_src_sel = CCL_LUT_INPUT_SRC_IO;
    conf.filter_sel = CCL_LUTCTRL_FILTSEL_FILTER;
    
  6. Set up LUT0 input and output pin.
    struct system_pinmux_config lut0_input_pin0_conf, lut0_input_pin1_conf, lut0_input_pin2_conf;
    system_pinmux_get_config_defaults(&lut0_input_pin0_conf);
    system_pinmux_get_config_defaults(&lut0_input_pin1_conf);
    system_pinmux_get_config_defaults(&lut0_input_pin2_conf);
    lut0_input_pin0_conf.direction    = SYSTEM_PINMUX_PIN_DIR_INPUT;
    lut0_input_pin0_conf.mux_position = CCL_LUT0_IN0_MUX;
    lut0_input_pin1_conf.direction    = SYSTEM_PINMUX_PIN_DIR_INPUT;
    lut0_input_pin1_conf.mux_position = CCL_LUT0_IN1_MUX;
    lut0_input_pin2_conf.direction    = SYSTEM_PINMUX_PIN_DIR_INPUT;
    lut0_input_pin2_conf.mux_position = CCL_LUT0_IN2_MUX;
    system_pinmux_pin_set_config(CCL_LUT0_IN0_PIN, &lut0_input_pin0_conf);
    system_pinmux_pin_set_config(CCL_LUT0_IN1_PIN, &lut0_input_pin1_conf);
    system_pinmux_pin_set_config(CCL_LUT0_IN2_PIN, &lut0_input_pin2_conf);
    struct system_pinmux_config lut0_out_pin_conf;
    system_pinmux_get_config_defaults(&lut0_out_pin_conf);
    lut0_out_pin_conf.direction    = SYSTEM_PINMUX_PIN_DIR_OUTPUT;
    lut0_out_pin_conf.mux_position = CCL_LUT0_OUT_MUX;
    system_pinmux_pin_set_config(CCL_LUT0_OUT_PIN, &lut0_out_pin_conf);
    
  7. Writes LUT0 configuration to the hardware module.
    ccl_lut_set_config(CCL_LUT_0, &conf);
    
  8. Creates a LUT configuration struct, which can be filled out to adjust the configuration of LUT1.
    struct ccl_lut_config conf;
    
    1. Fill the LUT1 configuration struct with the default settings.
      ccl_lut_get_config_defaults(&conf);
      
  9. Adjust the LUT1 configuration struct.
    conf.truth_table_value = 0x02;
    conf.input0_src_sel = CCL_LUT_INPUT_SRC_IO;
    conf.input1_src_sel = CCL_LUT_INPUT_SRC_IO;
    conf.input2_src_sel = CCL_LUT_INPUT_SRC_IO;
    conf.filter_sel = CCL_LUTCTRL_FILTSEL_FILTER;
    
  10. Set up LUT1 input and output pin.
    struct system_pinmux_config lut1_input_pin0_conf, lut1_input_pin1_conf, lut1_input_pin2_conf;
    system_pinmux_get_config_defaults(&lut1_input_pin0_conf);
    system_pinmux_get_config_defaults(&lut1_input_pin1_conf);
    system_pinmux_get_config_defaults(&lut1_input_pin2_conf);
    lut1_input_pin0_conf.direction    = SYSTEM_PINMUX_PIN_DIR_INPUT;
    lut1_input_pin0_conf.mux_position = CCL_LUT1_IN0_MUX;
    lut1_input_pin1_conf.direction    = SYSTEM_PINMUX_PIN_DIR_INPUT;
    lut1_input_pin1_conf.mux_position = CCL_LUT1_IN1_MUX;
    lut1_input_pin2_conf.direction    = SYSTEM_PINMUX_PIN_DIR_INPUT;
    lut1_input_pin2_conf.mux_position = CCL_LUT1_IN2_MUX;
    system_pinmux_pin_set_config(CCL_LUT1_IN0_PIN, &lut1_input_pin0_conf);
    system_pinmux_pin_set_config(CCL_LUT1_IN1_PIN, &lut1_input_pin1_conf);
    system_pinmux_pin_set_config(CCL_LUT1_IN2_MUX, &lut1_input_pin2_conf);
    struct system_pinmux_config lut1_out_pin_conf;
    system_pinmux_get_config_defaults(&lut1_out_pin_conf);
    lut1_out_pin_conf.direction    = SYSTEM_PINMUX_PIN_DIR_OUTPUT;
    lut1_out_pin_conf.mux_position = CCL_LUT1_OUT_MUX;
    system_pinmux_pin_set_config(CCL_LUT1_OUT_PIN, &lut1_out_pin_conf);
    
  11. Writes LUT1 configuration to the hardware module.
    ccl_lut_set_config(CCL_LUT_1, &conf);
    
  12. Configure the sequential logic with the D flip flop mode.
    ccl_seq_config(CCL_SEQ_0, CCL_SEQ_D_FLIP_FLOP);