#include <string.h>
#include "compiler.h"
#include "board.h"
#include "print_funcs.h"
#include "gpio.h"
#include "pm.h"
#include "intc.h"
#include "usart.h"
Macros | |
#define | DMACA_RAM2RAM_EVAL_BUF_SIZE 256 |
Board-Related Example Settings | |
#define | DMACA_RAM2RAM_EVAL_USART (&AVR32_USART1) |
#define | DMACA_RAM2RAM_EVAL_USART_RX_PIN AVR32_USART1_RXD_0_0_PIN |
#define | DMACA_RAM2RAM_EVAL_USART_RX_FUNCTION AVR32_USART1_RXD_0_0_FUNCTION |
#define | DMACA_RAM2RAM_EVAL_USART_TX_PIN AVR32_USART1_TXD_0_0_PIN |
#define | DMACA_RAM2RAM_EVAL_USART_TX_FUNCTION AVR32_USART1_TXD_0_0_FUNCTION |
#define | DMACA_RAM2RAM_EVAL_USART_BAUDRATE 57600 |
#define | DMACA_RAM2RAM_EVAL_LED1 LED0_GPIO |
#define | DMACA_RAM2RAM_EVAL_LED2 LED1_GPIO |
#define | DMACA_RAM2RAM_EVAL_LED3 LED2_GPIO |
#define | DMACA_RAM2RAM_EVAL_LED4 LED3_GPIO |
Functions | |
static void | dmaca_error_int_handler (void) |
The DMACA Error interrupt handler. More... | |
static void | dmaca_transfer_int_handler (void) |
The DMACA Transfer Complete interrupt handler. More... | |
static void | init_hmatrix (void) |
Initializes the HSB bus matrix. More... | |
int | main (void) |
The main function. More... | |
static void | test_ram_to_ram (uint16_t u16BufferSize, volatile uint32_t *pSrcBuf, volatile uint32_t *pDstBuf) |
Variables | |
volatile uint32_t | dest_data_cpu_sram [DMACA_RAM2RAM_EVAL_BUF_SIZE] |
volatile uint32_t * | dest_data_hsb_sram_ptr |
volatile uint32_t | end_cycle_count |
volatile uint32_t | source_data_cpu_sram [DMACA_RAM2RAM_EVAL_BUF_SIZE] |
volatile uint32_t * | source_data_hsb_sram_ptr |
volatile uint32_t | start_cycle_count |
#define DMACA_RAM2RAM_EVAL_BUF_SIZE 256 |
Referenced by main(), and test_ram_to_ram().
#define DMACA_RAM2RAM_EVAL_LED1 LED0_GPIO |
Referenced by dmaca_transfer_int_handler().
#define DMACA_RAM2RAM_EVAL_LED2 LED1_GPIO |
Referenced by dmaca_error_int_handler().
#define DMACA_RAM2RAM_EVAL_LED3 LED2_GPIO |
Referenced by dmaca_transfer_int_handler().
#define DMACA_RAM2RAM_EVAL_LED4 LED3_GPIO |
Referenced by dmaca_error_int_handler().
#define DMACA_RAM2RAM_EVAL_USART (&AVR32_USART1) |
Referenced by main(), and test_ram_to_ram().
#define DMACA_RAM2RAM_EVAL_USART_BAUDRATE 57600 |
Referenced by main().
#define DMACA_RAM2RAM_EVAL_USART_RX_FUNCTION AVR32_USART1_RXD_0_0_FUNCTION |
Referenced by main().
#define DMACA_RAM2RAM_EVAL_USART_RX_PIN AVR32_USART1_RXD_0_0_PIN |
Referenced by main().
#define DMACA_RAM2RAM_EVAL_USART_TX_FUNCTION AVR32_USART1_TXD_0_0_FUNCTION |
Referenced by main().
#define DMACA_RAM2RAM_EVAL_USART_TX_PIN AVR32_USART1_TXD_0_0_PIN |
Referenced by main().
|
static |
The DMACA Error interrupt handler.
References DMACA_RAM2RAM_EVAL_LED2, DMACA_RAM2RAM_EVAL_LED4, and gpio_clr_gpio_pin().
Referenced by main().
|
static |
The DMACA Transfer Complete interrupt handler.
References DMACA_RAM2RAM_EVAL_LED1, DMACA_RAM2RAM_EVAL_LED3, and gpio_clr_gpio_pin().
Referenced by main().
|
static |
Initializes the HSB bus matrix.
Referenced by main().
int main | ( | void | ) |
The main function.
It sets up the USART module on EXAMPLE_USART. The terminal settings are 57600 8N1. Then it sets up the interrupt handler and waits for a USART interrupt to trigger.
References usart_options_t::baudrate, pm_freq_param_t::cpu_f, dest_data_cpu_sram, dest_data_hsb_sram_ptr, Disable_global_interrupt, dmaca_error_int_handler(), DMACA_RAM2RAM_EVAL_BUF_SIZE, DMACA_RAM2RAM_EVAL_USART, DMACA_RAM2RAM_EVAL_USART_BAUDRATE, DMACA_RAM2RAM_EVAL_USART_RX_FUNCTION, DMACA_RAM2RAM_EVAL_USART_RX_PIN, DMACA_RAM2RAM_EVAL_USART_TX_FUNCTION, DMACA_RAM2RAM_EVAL_USART_TX_PIN, dmaca_transfer_int_handler(), Enable_global_interrupt, FOSC0, gpio_enable_module(), init_hmatrix(), INTC_init_interrupts(), INTC_register_interrupt(), OSC0_STARTUP, pm_configure_clocks(), PM_FREQ_STATUS_FAIL, print(), print_ulong(), SLEEP, source_data_cpu_sram, source_data_hsb_sram_ptr, test_ram_to_ram(), USART_1_STOPBIT, usart_init_rs232(), USART_NO_PARITY, and USART_NORMAL_CHMODE.
|
static |
References DMACA_RAM2RAM_EVAL_BUF_SIZE, DMACA_RAM2RAM_EVAL_USART, end_cycle_count, Get_system_register, print(), print_ulong(), and start_cycle_count.
Referenced by main().
volatile uint32_t dest_data_cpu_sram[DMACA_RAM2RAM_EVAL_BUF_SIZE] |
Referenced by main().
volatile uint32_t* dest_data_hsb_sram_ptr |
Referenced by main().
volatile uint32_t end_cycle_count |
Referenced by test_ram_to_ram().
volatile uint32_t source_data_cpu_sram[DMACA_RAM2RAM_EVAL_BUF_SIZE] |
Referenced by main().
volatile uint32_t* source_data_hsb_sram_ptr |
Referenced by main().
volatile uint32_t start_cycle_count |
Referenced by test_ram_to_ram().