#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 "delay.h"
Macros | |
#define | PDCA_CHANNEL_IRQ AVR32_PDCA_IRQ_0 |
#define | PDCA_CHANNEL_USART 0 |
The PDCA channel instance for the USART0 Tx. More... | |
#define | PEVC_PDCA_SOT_USER AVR32_PEVC_ID_USER_PDCA_0 |
#define | STRING_TRANSFER_SIZE 36 |
Size of the string to transfer to USART0 through the PDCA. More... | |
Functions | |
void | init_gclk (void) |
GCLK 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) |
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 |
The PDCA channel instance for the USART0 Tx.
Referenced by init_pdca(), and pdca_int_handler().
#define PEVC_PDCA_SOT_USER AVR32_PEVC_ID_USER_PDCA_0 |
Referenced by init_pevc().
#define STRING_TRANSFER_SIZE 36 |
Size of the string to transfer to USART0 through the PDCA.
void init_gclk | ( | void | ) |
GCLK init.
References scif_gclk_opt_t::clock_source, opt, SCIF_GCCTRL_OSC32K, SCIF_OSC_MODE_2PIN_CRYSTAL, scif_start_gclk(), and scif_start_osc32().
void init_pdca | ( | void | ) |
PDCA init.
References aDataTransfered, pdca_channel_options_t::addr, Disable_global_interrupt, Enable_global_interrupt, 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(), and PDCA_TRANSFER_SIZE_BYTE.
void init_pevc | ( | void | ) |
PEVC init.
References AVR32_PEVC_ID_GEN_GCLK_0, FAIL, gpio_clr_gpio_pin(), pevc_evs_opt_t::igfdr, pevc_channel_configure(), pevc_channels_enable(), PEVC_EVS_EVF_OFF, PEVC_EVS_EVR_ON, PEVC_EVS_IGF_OFF, PEVC_PDCA_SOT_USER, ppevc, and print_dbg().
void init_usart | ( | void | ) |
int main | ( | void | ) |
References aDataTransfered, delay_init, delay_ms, FCPU_HZ, gpio_clr_gpio_pin(), gpio_tgl_gpio_pin(), i, init_gclk(), init_pdca(), init_pevc(), init_sys_clocks(), and init_usart().
|
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] |
volatile avr32_pdca_channel_t* pdca_channel |
volatile avr32_pm_t* pm = &AVR32_PM |
Referenced by reset_cause_get_causes().
volatile avr32_pevc_t* ppevc = &AVR32_PEVC |
|
static |
Referenced by pdca_int_handler().