DAC Management Task.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "compiler.h"
#include "gpio.h"
#include "dacifb.h"
#include "pdca.h"
#include "sinus.h"
#include "pevc.h"
#include "dac_task.h"
#include "scif_uc3c.h"
#include "sysclk.h"
#include "conf_demo.h"
Functions | |
void | dac_task (void) |
DAC Task: More... | |
void | dac_task_init (void) |
DAC Init function : More... | |
void | init_gclk (void) |
void | init_pevc (void) |
ISR (pdca_int_handler, AVR32_PDCA_IRQ_GROUP1, 1) | |
The PDCA interrupt handler. More... | |
Variables | |
volatile avr32_dacifb_t * | dacifb = &AVR32_DACIFB0 |
dacifb_channel_opt_t | dacifb_channel_opt |
dacifb_opt_t | dacifb_opt |
volatile bool | flag_dac = false |
volatile avr32_pevc_t * | ppevc = &AVR32_PEVC |
uint16_t | SIGNAL_TABLE [SIGNAL_NB_SAMPLES] |
void dac_task | ( | void | ) |
DAC Task:
Referenced by main().
void dac_task_init | ( | void | ) |
DAC Init function :
References pdca_channel_options_t::addr, cpu_irq_restore(), cpu_irq_save(), DAC_OUTPUT_CHANNEL, DAC_OUTPUT_FUNCTION, DAC_OUTPUT_INSTANCE, DAC_OUTPUT_PIN, DAC_PDCA_CHANNEL_DAC, DAC_PDCA_PID_DAC_TX, dacifb, dacifb_configure(), dacifb_configure_channel(), dacifb_get_calibration_data(), dacifb_start_channel(), gpio_enable_module(), i, init_gclk(), init_pevc(), irq_register_handler, NULL, pdca_enable(), pdca_enable_interrupt_reload_counter_zero(), pdca_init_channel(), pdca_int_handler(), PDCA_OPTIONS, PDCA_TRANSFER_SIZE_HALF_WORD, dacifb_opt_t::prescaler_clock_hz, SIGNAL_NB_SAMPLES, SIGNAL_TABLE, and sysclk_get_pba_hz().
Referenced by main().
void init_gclk | ( | void | ) |
References scif_gc_enable(), scif_gc_setup(), and SCIF_GCCTRL_OSC0.
Referenced by dac_task_init(), and main().
void init_pevc | ( | void | ) |
ISR | ( | pdca_int_handler | , |
AVR32_PDCA_IRQ_GROUP1 | , | ||
1 | |||
) |
The PDCA interrupt handler.
The handler reload the PDCA settings using the reload register. The interrupt will happen each time the buffer is transmitted to the DAC.
References DAC_PDCA_CHANNEL_DAC, flag_dac, pdca_reload_channel(), SIGNAL_NB_SAMPLES, and SIGNAL_TABLE.
volatile avr32_dacifb_t* dacifb = &AVR32_DACIFB0 |
Referenced by dac_task_init().
dacifb_channel_opt_t dacifb_channel_opt |
dacifb_opt_t dacifb_opt |
volatile avr32_pevc_t* ppevc = &AVR32_PEVC |
uint16_t SIGNAL_TABLE[SIGNAL_NB_SAMPLES] |
Referenced by dac_task_init(), and ISR().