Microchip® Advanced Software Framework

sam0/applications/ccl_example/main.c File Reference

CCL Example Application.

Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "conf_ccl_example.h"

Macros

#define BUF_LENGTH   10
 Create arrays for storing modulator signal period and compare value. More...
 

Functions

void configure_ccl_lut0 (void)
 
static void configure_dma_channel_0 (DmacDescriptor *descriptor)
 
static void configure_dma_channel_1 (DmacDescriptor *descriptor)
 
void configure_dma_evsys (void)
 
static void configure_dma_resource (struct dma_resource *resource)
 
void configure_dmac (void)
 
void configure_tc_alt (void)
 
void configure_tc_def (void)
 
void configure_tc_evsys (void)
 
int main (void)
 

Variables

DmacDescriptor descriptor0
 Create descriptors for DMA. More...
 
DmacDescriptor descriptor1
 
struct dma_resource dma_ch_0
 
struct dma_resource dma_ch_1
 
uint8_t period_buffer [BUF_LENGTH] = {0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7}
 
struct tc_module tc_alt
 
struct tc_module tc_def
 Create structs for TC and DMA. More...
 
uint8_t value_buffer [BUF_LENGTH] = {0x2,0x2,0x2,0x2,0x2,0x5,0x5,0x5,0x5,0x5}
 

#define BUF_LENGTH   10

Create arrays for storing modulator signal period and compare value.

Referenced by configure_dma_channel_0(), and configure_dma_channel_1().

void configure_ccl_lut0 ( void  )

Creates a new configuration structure for CCL.

Apply the default settings.

Initialize CCL with the user settings.

Creates a new configuration structure for LUT0.

Apply the default settings.

Configure LUT0.

Set up LUT0 output pin.

Initialize and enable LUT0 with the user settings.

Enable CCL module.

void configure_dma_evsys ( void  )
static void configure_dma_resource ( struct dma_resource resource)
static

Creates a new configuration structure for the DMA resource.

Apply the default settings.

Configure DMAC channel 0/1 to transfer data on TC overflow.

Allocate DMAC channel 0/1.

void configure_dmac ( void  )

Configure the DMA resources and channels.

Add both descriptors.

Enable both channels for transfer.

References configure_dma_channel_0(), configure_dma_channel_1(), configure_dma_resource(), descriptor0, descriptor1, dma_add_descriptor(), dma_ch_0, dma_ch_1, and dma_start_transfer_job().

Referenced by main().

void configure_tc_evsys ( void  )
int main ( void  )

Configure TC, DMAC and CCL.

Configure event system.

Enable CCL_TC and CCL_ALTTC.

Enter Standby sleep mode.

Keep alive while generating IR encoded signal.

References configure_ccl_lut0(), configure_dma_evsys(), configure_dmac(), configure_tc_alt(), configure_tc_def(), configure_tc_evsys(), system_init(), system_set_sleepmode(), system_sleep(), SYSTEM_SLEEPMODE_STANDBY, tc_alt, tc_def, and tc_enable().

DmacDescriptor descriptor0

Create descriptors for DMA.

Referenced by configure_dmac().

DmacDescriptor descriptor1

Referenced by configure_dmac().

struct dma_resource dma_ch_0

Referenced by configure_dmac().

struct dma_resource dma_ch_1

Referenced by configure_dmac().

uint8_t period_buffer[BUF_LENGTH] = {0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7}

Referenced by configure_dma_channel_0().

struct tc_module tc_def

Create structs for TC and DMA.

Referenced by configure_tc_def(), and main().

uint8_t value_buffer[BUF_LENGTH] = {0x2,0x2,0x2,0x2,0x2,0x5,0x5,0x5,0x5,0x5}

Referenced by configure_dma_channel_1().