#include <avr32/io.h>
#include "board.h"
#include "intc.h"
#include "power_clocks_lib.h"
#include "pevc.h"
#include "gpio.h"
#include "usart.h"
#include "print_funcs.h"
#include "pdca.h"
#include "ast.h"
#include "delay.h"
#include "conf_clock.h"
Macros | |
#define | PDCA_CHANNEL_IRQ AVR32_PDCA_IRQ_0 |
#define | PDCA_CHANNEL_USART 0 |
#define | PEVC_PDCA_SOT_USER AVR32_PEVC_ID_USER_PDCA_0 |
String transfer size | |
#define | STRING_TRANSFER_SIZE 36 |
Functions | |
void | init_ast (void) |
AST Init. More... | |
void | init_pdca (void) |
PDCA Init. More... | |
void | init_pevc (void) |
PEVC Init. More... | |
void | init_usart (void) |
USART init. More... | |
int | main (void) |
This example show a DMA transfer to USART controlled by the AST periodic alarm using the PEVC. More... | |
static void | pdca_int_handler (void) |
PDCA Interrupts handler. More... | |
Variables | |
unsigned char | aDataTransfered [STRING_TRANSFER_SIZE] |
volatile avr32_pdca_channel_t * | pdca_channel |
volatile avr32_pm_t * | pm = &AVR32_PM |
volatile avr32_pevc_t * | ppevc = &AVR32_PEVC |
static volatile U32 | u32PdcaIsr |
#define PDCA_CHANNEL_IRQ AVR32_PDCA_IRQ_0 |
Referenced by init_pdca().
#define PDCA_CHANNEL_USART 0 |
Referenced by init_pdca(), and pdca_int_handler().
#define PEVC_PDCA_SOT_USER AVR32_PEVC_ID_USER_PDCA_0 |
Referenced by init_pdca(), and init_pevc().
#define STRING_TRANSFER_SIZE 36 |
void init_ast | ( | void | ) |
AST Init.
References ast_enable(), ast_enable_periodic0(), ast_init_calendar(), AST_OSC_32KHZ, AST_PSEL_32KHZ_1HZ, ast_set_periodic0_value(), ast_calendar_t::FIELD, scif_osc32_opt_t::mode, print_dbg(), SCIF_OSC_MODE_2PIN_CRYSTAL, scif_start_osc32(), and scif_osc32_opt_t::startup.
Referenced by main().
void init_pdca | ( | void | ) |
PDCA Init.
References aDataTransfered, pdca_channel_options_t::addr, Disable_global_interrupt, Enable_global_interrupt, INTC_init_interrupts(), INTC_register_interrupt(), pdca_channel, PDCA_CHANNEL_IRQ, PDCA_CHANNEL_USART, pdca_enable(), pdca_enable_interrupt_transfer_complete(), pdca_enable_interrupt_transfer_error(), pdca_get_handler(), pdca_init_channel(), pdca_int_handler(), PDCA_TRANSFER_SIZE_BYTE, PEVC_CHANNELS_ENABLE, PEVC_PDCA_SOT_USER, and ppevc.
Referenced by main().
void init_pevc | ( | void | ) |
PEVC Init.
References AVR32_PEVC_ID_GEN_AST_PER0, FAIL, gpio_clr_gpio_pin(), LED2_GPIO, pevc_channel_configure(), pevc_channels_enable(), PEVC_PDCA_SOT_USER, ppevc, and print_dbg().
Referenced by main().
void init_usart | ( | void | ) |
int main | ( | void | ) |
This example show a DMA transfer to USART controlled by the AST periodic alarm using the PEVC.
References aDataTransfered, delay_ms, gpio_clr_gpio_pin(), gpio_tgl_gpio_pin(), init_ast(), init_pdca(), init_pevc(), init_usart(), LED0_GPIO, and LED1_GPIO.
|
static |
PDCA Interrupts handler.
References aDataTransfered, pdca_channel, PDCA_CHANNEL_USART, pdca_reload_channel(), print_dbg(), and u32PdcaIsr.
Referenced by init_pdca().
unsigned char aDataTransfered[STRING_TRANSFER_SIZE] |
Referenced by init_pdca(), main(), and pdca_int_handler().
volatile avr32_pdca_channel_t* pdca_channel |
Referenced by init_pdca(), pdca_disable(), pdca_disable_interrupt_reload_counter_zero(), pdca_disable_interrupt_transfer_complete(), pdca_disable_interrupt_transfer_error(), pdca_enable(), pdca_enable_interrupt_reload_counter_zero(), pdca_enable_interrupt_transfer_complete(), pdca_enable_interrupt_transfer_error(), pdca_get_channel_status(), pdca_get_handler(), pdca_get_load_size(), pdca_get_reload_size(), pdca_get_transfer_status(), pdca_init_channel(), pdca_int_handler(), pdca_load_channel(), pdca_reload_channel(), pdca_set_peripheral_select(), and pdca_set_transfer_size().
volatile avr32_pm_t* pm = &AVR32_PM |
volatile avr32_pevc_t* ppevc = &AVR32_PEVC |
Referenced by init_pdca(), and init_pevc().
|
static |
Referenced by pdca_int_handler().