AT10942: SAM Configurable Custom Logic (CCL) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

Similar documents
AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

SAM4 Reset Controller (RSTC)

APPLICATION NOTE. AT05567: TC Capture on External Interrupt with the Event System on SAM D20. Preface ASF PROJECT DOCUMENTATION

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

APPLICATION NOTE. AT06863: SAM4L Peripheral Event Controller (PEVC) SAM4L Peripheral Event Controller (PEVC) ASF PROGRAMMERS MANUAL

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

AT07942: SAM4L Asynchronous Timer (AST) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT03975: Getting Started with SAM L21. Descripton. Features. SMART ARM-Based Microcontroller APPLICATION NOTE

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

SAM4L Asynchronous Timer (AST)

APPLICATION NOTE. AT6486: Using DIVAS on SAMC Microcontroller. SMART ARM-Based Microcontroller. Introduction. Features

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

AT06467: Getting started with SAM D09/D10/D11. Features. Description. SMART ARM-based Microcontrollers APPLICATION NOTE

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

APPLICATION NOTE. 3-lead CONTACT Package Usage. ATSHA204A, ATECC108A, and ATECC508A. Introduction. 3-lead CONTACT Package

APPLICATION NOTE. AT04470: Differences between SAM D21 Variants A, B, and L. 32-bit Microcontroller. Introduction

This user guide describes how to run the Atmel ATWINC3400 Bluetooth Low Energy (BLE) Provisioning demo from out-of-box conditions.

USER GUIDE. Atmel QT6 Xplained Pro. Preface

EDBG. Description. Programmers and Debuggers USER GUIDE

APPLICATION NOTE. Generating Random Secrets. ATSHA204A, ATECC108A, and ATECC508A. Description. Topics

AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE

QT3 Xplained Pro. Preface. Atmel QTouch USER GUIDE

Ethernet1 Xplained Pro

APPLICATION NOTE. AT11008: Migration from ATxmega16D4/32D4 Revision E to Revision I. Atmel AVR XMEGA. Introduction. Features

DGILib USER GUIDE Atmel-42771A-DGILib_User Guide-09/2016

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

SAM4L Liquid Crystal Display (LCDCA)

ATECC508A Public Key Validation. Introduction. Atmel CryptoAuthentication APPLICATION NOTE

SAMA5D2 Quad SPI (QSPI) Performance. Introduction. SMART ARM-based Microprocessor APPLICATION NOTE

QT2 Xplained Pro. Preface. Atmel QTouch USER GUIDE

ATtiny817 QTouch Moisture Demo User Guide. Description. Features. AVR 8-bit Microcontrollers USER GUIDE

AT88CK101 HARDWARE USER GUIDE. Atmel CryptoAuthentication Development Kit. Atmel CryptoAuthentication AT88CK101 Daughterboard

APPLICATION NOTE. How to Securely Switch Atmel s LIN Transceiver ATA6662/ATA6662C to Sleep Mode ATA6662/ATA6662C. Concerning Atmel ATA6662

Native route discovery algorithm

APPLICATION NOTE. Atmel QT4 Xplained Pro User Guide ATAN0114. Preface

Smart RF Device Family - Getting Started Guide. Features. Description. References ATAN0115 APPLICATION NOTE

APPLICATION NOTE. CryptoAuthentication Personalization Guide. ATSHA204A and ATECC508A. Introduction. Features

USER GUIDE. ATWINC1500 Xplained Pro. Preface

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

APPLICATION NOTE. Atmel AVR1638: XMEGA RTC Calibration. 8-bit Atmel Microcontrollers. Features. Introduction

OLED display with pixels resolution Ambient light sensor CPU load Analog filter Quadrature Encoder with push button Digital I/O

Hardware Prerequisites Atmel Xplained Pro Evaluation Kit Atmel WINC1500 extension USB Micro Cable (TypeA / MicroB)

ATtiny104 Xplained Nano. Preface. AVR 8-bit Microcontrollers USER GUIDE

Application Note Using the ATV750, ATV750B, and ATF750C Erasable Programmable Logic Device Introduction 1.1 Device Names and Pin/Node Assignments

APPLICATION NOTE. Scope. Reference Documents. Software Ethernet Bridge on SAMA5D3/D4. Atmel SMART SAMA5D3/D4 Series

USER GUIDE. Atmel QT1 Xplained Pro. Preface

AVR1501: Xplain training XMEGA Timer/Counter 8-bit Microcontrollers Application Note Prerequisites 1 Introduction

Atmel AVR32847: Migration from/to the UC3L0 64/32/16 from/to the UC3L0 256/ bit Atmel Microcontrollers. Application Note.

64K (8K x 8) Battery-Voltage Parallel EEPROM with Page Write and Software Data Protection AT28BV64B

Ecma International Policy on Submission, Inclusion and Licensing of Software

AVR1303: Use and configuration of IR communication module. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

SMART ARM-based Microcontrollers ATSAMD21E16LMOTOR USER GUIDE

APPLICATION NOTE. AT03324: Atmel REB212BSMA-EK Quick Start Guide. Atmel MCU Wireless. Introduction

Intel Stress Bitstreams and Encoder (Intel SBE) 2017 AVS2 Release Notes (Version 2.3)

USER GUIDE. Atmel Segment LCD1 Xplained Pro. Preface

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

AT03255: SAM D/R/L/C Serial Peripheral Interface (SERCOM SPI) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

APPLICATION NOTE. Atmel AT03160: Migrating Bootloader from ATxmega128A1 to other Atmel XMEGA Devices. Atmel AVR XMEGA. Features.

Ecma International Policy on Submission, Inclusion and Licensing of Software

USER GUIDE. Atmel OLED1 Xplained Pro. Preface

Section 5 SERCOM. Tasks SPI. In this section you will learn:

USER GUIDE EDBG. Description

AVR1518: XMEGA-A1 Xplained Training - XMEGA Clock System. 8-bit Atmel Microcontrollers. Application Note. Prerequisites.

Documentation Roadmap for Cisco Prime LAN Management Solution 4.2

USER GUIDE. Atmel maxtouch Xplained Pro. Preface

Atmel AVR1619: XMEGA-B1 Xplained Demonstration. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

Open Source Used In TSP

End User License Agreement

MySonicWall Secure Upgrade Plus

HALCoGen TMS570LS31x Help: example_sci_uart_9600.c

USER GUIDE. ZigBit USB Stick User Guide. Introduction

RELEASE NOTES. GNU Toolchain for Atmel ARM Embedded Processors. Introduction

APPLICATION NOTE. Atmel AT01080: XMEGA E Schematic Checklist. Atmel AVR XMEGA E. Features. Introduction

Copyright PFU LIMITED

AVR1503: Xplain training - XMEGA Programmable Multi Interrupt Controller 8-bit Microcontrollers Application Note Prerequisites

Copyright PFU LIMITED 2016

a clock signal and a bi-directional data signal (SCL, SDA)

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

AT03664: Getting Started with FreeRTOS on SAM D20/D21/R21/L21/L22. Introduction. Features. SMART ARM-based Microcontrollers APPLICATION NOTE

I/O1 Xplained Pro. Preface. Atmel MCUs USER GUIDE

AVR1922: Xplain Board Controller Firmware 8-bit Microcontrollers Application Note Features 1 Introduction

AT88RF04C. CryptoRF EEPROM Memory 13.56MHz, 4 Kilobits SUMMARY DATASHEET. Features

This file includes important notes on this product and also the additional information not included in the manuals.

APPLICATION NOTE. Atmel AVR057: Internal RC Oscillator Calibration for ATtiny4/5/9/10/20/40. 8-bit Atmel Microcontrollers. Features.

AVR32752: Using the AVR32 UC3 Static Memory Controller. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Fujitsu ScandAll PRO V2.1.5 README

AT697E. Application Note. Checking AT697E Code for Occurrence of LDF/FPOPd Instructions Sequence with a dependency on an Odd-Numbered Register

Atmel QT600 Quick Start Guide Touch Solutions

IETF TRUST. Legal Provisions Relating to IETF Documents. Approved November 6, Effective Date: November 10, 2008

Mile Terms of Use. Effective Date: February, Version 1.1 Feb 2018 [ Mile ] Mileico.com

AT88SC3216CRF. CryptoRF EEPROM Memory 13.56MHz, 32 Kilobits SUMMARY DATASHEET. Features

APPLICATION NOTE. AT07216: SAM G55 Schematic Checklist. Atmel SMART SAM G55. Introduction

This file includes important notes on this product and also the additional information not included in the manuals.

Atmel and the use of Verilator to create uc Device Models

Atmel LF-RFID Kit Comparison Chart. Application Note. Atmel LF-RFID Kit Comparison Chart. 1. Description

TERMS & CONDITIONS. Complied with GDPR rules and regulation CONDITIONS OF USE PROPRIETARY RIGHTS AND ACCEPTABLE USE OF CONTENT

Transcription:

SMART ARM-based Microcontrollers AT10942: SAM Configurable Custom Logic (CCL) Driver APPLICATION NOTE Introduction This driver for Atmel SMART SAM devices provides an interface for the configuration and management of the device's Configurable Custom Logic functionality. The following peripheral is used by this module: CCL (Configurable Custom Logic) The following devices can use this module: Atmel SMART SAM L21 Atmel SMART SAM C20/C21 The outline of this documentation is as follows: Prerequisites Module Overview Special Considerations Extra Information Examples API Overview

Table of Contents Introduction...1 1. Software License... 3 2. Prerequisites...4 3. Module Overview...5 4. Special Considerations...6 5. Extra Information... 7 6. Examples...8 7. API Overview...9 7.1. Structure Definitions... 9 7.1.1. Struct ccl_config... 9 7.1.2. Struct ccl_lut_config...9 7.2. Function Definitions...9 7.2.1. Initialize and Reset CCL Module... 9 7.2.2. Enable and Disable CCL Module...10 7.2.3. Configure LUT... 10 7.2.4. Enable and Disable LUT...12 7.3. Enumeration Definitions... 12 7.3.1. Enum ccl_lut_filter_sel...12 7.3.2. Enum ccl_lut_id... 12 7.3.3. Enum ccl_lut_input_src_sel... 13 7.3.4. Enum ccl_seq_id... 13 7.3.5. Enum ccl_seq_selection... 13 8. Extra Information for CCL Driver... 15 8.1. Acronyms...15 8.2. Dependencies...15 8.3. Errata...15 8.4. Module History...15 9. Examples for CCL Driver...16 9.1. Quick Start Guide for CCL - Basic...16 9.1.1. Setup... 16 9.1.2. Use Case... 19 10. Document Revision History... 20 2

1. Software License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of Atmel may not be used to endorse or promote products derived from this software without specific prior written permission. 4. This software may only be redistributed and used in connection with an Atmel microcontroller product. THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3

2. Prerequisites There are no prerequisites for this module. 4

3. Module Overview 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. 5

4. Special Considerations There are no special considerations for this module. 6

5. Extra Information For extra information, see Extra Information for CCL Driver. This includes: Acronyms Dependencies Errata Module History 7

6. Examples For a list of examples related to this driver, see Examples for CCL Driver. 8

7. API Overview 7.1. Structure Definitions 7.1.1. Struct ccl_config Configuration structure for CCL module. Table 7-1 Members Type Name Description enum gclk_generator clock_source GCLK generator used to clock the peripheral bool run_in_standby If true, the GCLK_CCL clock will not stop in standby sleep mode 7.1.2. Struct ccl_lut_config Configuration structure for CCL LUT 0 to 3. Table 7-2 Members Type Name Description bool edge_selection_enable If true, Edge detector is enabled bool event_input_enable If true, LUT incoming event is enabled bool event_input_inverted_enable If true, incoming event is inverted bool event_output_enable If true, LUT event output is enabled enum ccl_lut_filter_sel filter_sel Selection of the LUT output filter options enum ccl_lut_input_src_sel input0_src_sel enum ccl_lut_input_src_sel input1_src_sel enum ccl_lut_input_src_sel input2_src_sel Selection of the input0 source Selection of the input1 source Selection of the input2 source uint8_t truth_table_value The value of truth logic as a function of inputs IN[2:0] 7.2. Function Definitions 7.2.1. Initialize and Reset CCL Module 7.2.1.1. Function ccl_init() Initializes CCL module. void ccl_init( struct ccl_config *const config) 9

Resets all registers in the MODULE to their initial state, and then enable the module. 7.2.1.2. Function ccl_get_config_defaults() Initializes all members of a CCL configuration structure to safe defaults. void ccl_get_config_defaults( struct ccl_config *const config) 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: GCLK_CLL will be stopped in standby sleep mode Generator 0 is the default GCLK generator Table 7-3 Parameters Data direction Parameter name Description [out] config Configuration structure to initialize to default values 7.2.1.3. Function ccl_module_reset() Resets CCL module. void ccl_module_reset( void ) Resets all registers in the MODULE to their initial state, and the CCL will be disabled. 7.2.2. Enable and Disable CCL Module 7.2.2.1. Function ccl_module_enable() Enables CCL module. void ccl_module_enable( void ) Enable the peripheral. 7.2.2.2. Function ccl_module_disable() Disables CCL module. void ccl_module_disable( void ) Disables the peripheral. 7.2.3. Configure LUT 7.2.3.1. Function ccl_seq_config() Writes sequential selection to the hardware module. enum status_code ccl_seq_config( const enum ccl_seq_id number, const enum ccl_seq_selection seq_selection) 10

Writes a given sequential selection configuration to the hardware module. Note: This function can only be used when the CCL module is disabled. Table 7-4 Parameters Data direction Parameter name Description [in] seq_selection Enum for the sequential selection configuration [in] number SEQ unit number to config 7.2.3.2. Function ccl_lut_get_config_defaults() Initializes all members of LUT configuration structure to safe defaults. void ccl_lut_get_config_defaults( struct ccl_lut_config *const config) 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: Truth table value is 0x00 LUT event output is disabled LUT incoming event is disabled LUT incoming event is not inverted The input IN[2:0] source is masked The edge detector is disabled The LUT output filter is disabled Table 7-5 Parameters Data direction Parameter name Description [out] config LUT configuration structure to initialize to default values 7.2.3.3. Function ccl_lut_set_config() Writes LUT configuration to the hardware module. enum status_code ccl_lut_set_config( const enum ccl_lut_id number, struct ccl_lut_config *const config) Writes a given LUT configuration to the hardware module. Note: This function can only be used when the CCL module is disabled. Table 7-6 Parameters Data direction Parameter name Description [in] config Pointer to the LUT configuration struct [in] number LUT number to config 11

7.2.4. Enable and Disable LUT 7.2.4.1. Function ccl_lut_enable() Enables an LUT that was previously configured. void ccl_lut_enable( const enum ccl_lut_id number) Enables an LUT that was previously configured via a call to ccl_lut_set_config function. Table 7-7 Parameters Data direction Parameter name Description [in] number LUT number to enable 7.2.4.2. Function ccl_lut_disable() Disables an LUT that was previously enabled. void ccl_lut_disable( const enum ccl_lut_id number) Disables an LUT that was previously enabled via a call to ccl_lut_enable(). Table 7-8 Parameters Data direction Parameter name Description [in] number LUT number to enable 7.3. Enumeration Definitions 7.3.1. Enum ccl_lut_filter_sel Enum for the LUT output filter options. Table 7-9 Members Enum value CCL_LUT_FILTER_DISABLE CCL_LUT_FILTER_SYNC CCL_LUT_FILTER_ENABLE Description Filter disabled Synchronizer enabled Filter enabled 7.3.2. Enum ccl_lut_id Table 7-10 Members Enum value Description CCL_LUT_0 CCL LUT 0 CCL_LUT_1 CCL LUT 1 12

Enum value Description CCL_LUT_2 CCL LUT 2 CCL_LUT_3 CCL LUT 3 7.3.3. Enum ccl_lut_input_src_sel Enum for the LUT Input source selection. Table 7-11 Members Enum value CCL_LUT_INPUT_SRC_MASK CCL_LUT_INPUT_SRC_FEEDBACK CCL_LUT_INPUT_SRC_LINK CCL_LUT_INPUT_SRC_EVENT CCL_LUT_INPUT_SRC_IO CCL_LUT_INPUT_SRC_AC CCL_LUT_INPUT_SRC_TC CCL_LUT_INPUT_SRC_ALTTC CCL_LUT_INPUT_SRC_TCC CCL_LUT_INPUT_SRC_SERCOM Description Masked input Feedback input source Linked LUT input source Event input source I/O pin input source AC input source TC input source Alternative TC input source TCC input source SERCOM input source 7.3.4. Enum ccl_seq_id Table 7-12 Members Enum value Description CCL_SEQ_0 CCL SEQ 0 CCL_SEQ_1 CCL SEQ 1 7.3.5. Enum ccl_seq_selection Enum for the sequential selection configuration. Table 7-13 Members Enum value CCL_SEQ_DISABLED CCL_SEQ_D_FLIP_FLOP CCL_SEQ_JK_FLIP_FLOP Description Sequential logic is disabled D flip flop JK flip flop 13

Enum value CCL_SEQ_D_LATCH CCL_SEQ_RS_LATCH Description D latch RS latch 14

8. Extra Information for CCL Driver 8.1. Acronyms Below is a table listing the acronyms used in this module, along with their intended meanings. Acronym CCL Description Configurable Custom Logic 8.2. Dependencies This driver has no dependencies. 8.3. Errata There are no errata related to this driver. 8.4. Module History An overview of the module history is presented in the table below, with details on the enhancements and fixes made to the module since its first release. The current version of this corresponds to the newest version in the table. Changelog Initial Release 15

9. Examples for CCL Driver This is a list of the available Quick Start guides (QSGs) and example applications for SAM Configurable Custom Logic (CCL) Driver. QSGs are simple examples with step-by-step instructions to configure and use this driver in a selection of use cases. Note that a QSG can be compiled as a standalone application or be added to the user application. Quick Start Guide for CCL - Basic 9.1. Quick Start Guide for CCL - Basic 9.1.1. Setup 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. 9.1.1.1. Prerequisites 9.1.1.2. Code There are no special setup requirements for this use-case. Copy-paste the following setup code to your user application: void configure_ccl(void) { struct ccl_config conf; ccl_get_config_defaults(&conf); } ccl_init(&conf); void configure_ccl_lut0(void) { struct ccl_lut_config conf; ccl_lut_get_config_defaults(&conf); 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; 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); 16

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); } ccl_lut_set_config(ccl_lut_0, &conf); void configure_ccl_lut1(void) { struct ccl_lut_config conf; ccl_lut_get_config_defaults(&conf); 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; 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); } ccl_lut_set_config(ccl_lut_1, &conf); Add to user application initialization (typically the start of main()): configure_ccl(); configure_ccl_lut0(); configure_ccl_lut1(); ccl_seq_config(ccl_seq_0, CCL_SEQ_D_FLIP_FLOP); ccl_lut_enable(ccl_lut_0); ccl_lut_enable(ccl_lut_1); ccl_module_enable(); 9.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; 17

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; 18

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); 9.1.2. Use Case 9.1.2.1. Code Copy-paste the following code to your user application: while (true) { /* Do nothing */ } 19

10. Document Revision History Doc. Rev. Date Comments 42448A 06/2015 Initial document release 20

Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311 F: (+1)(408) 436.4200 www.atmel.com 2015 Atmel Corporation. / Rev.: Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, and others are registered trademarks or trademarks of Atmel Corporation in U.S. and other countries. ARM, ARM Connected, and others are registered trademarks of ARM Ltd. Other terms and product names may be trademarks of others. DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death ( Safety-Critical Applications ) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade.