#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, scif_osc32_opt_t::mode, SCIF_GCCTRL_OSC32K, SCIF_OSC_MODE_2PIN_CRYSTAL, scif_start_gclk(), and scif_start_osc32().
Referenced by main().
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.
Referenced by main().
void init_pevc | ( | void | ) |
PEVC init.
References AVR32_PEVC_ID_GEN_GCLK_0, FAIL, gpio_clr_gpio_pin(), pevc_evs_opt_t::igfdr, LED2_GPIO, 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().
Referenced by main().
void init_usart | ( | void | ) |
int main | ( | void | ) |
References aDataTransfered, delay_init, delay_ms, FCPU_HZ, gpio_clr_gpio_pin(), gpio_tgl_gpio_pin(), init_gclk(), 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_pevc().
|
static |
Referenced by pdca_int_handler().