Atmel Software Framework

ast_example1.c File Reference

AST example driver for AVR32 UC3.

Copyright (C) 2009-2015 Atmel Corporation. All rights reserved.

#include <avr32/io.h>
#include "intc.h"
#include "board.h"
#include "compiler.h"
#include "ast.h"
#include "usart.h"
#include "gpio.h"
#include "power_clocks_lib.h"

Macros

USART Settings
#define EXAMPLE_USART   (&AVR32_USART2)
 
#define EXAMPLE_USART_RX_PIN   AVR32_USART2_RXD_0_1_PIN
 
#define EXAMPLE_USART_RX_FUNCTION   AVR32_USART2_RXD_0_1_FUNCTION
 
#define EXAMPLE_USART_TX_PIN   AVR32_USART2_TXD_0_1_PIN
 
#define EXAMPLE_USART_TX_FUNCTION   AVR32_USART2_TXD_0_1_FUNCTION
 
#define FPBA   FOSC0
 
#define EXAMPLE_USART   (&AVR32_USART3)
 
#define EXAMPLE_USART_RX_PIN   AVR32_USART3_RXD_0_0_PIN
 
#define EXAMPLE_USART_RX_FUNCTION   AVR32_USART3_RXD_0_0_FUNCTION
 
#define EXAMPLE_USART_TX_PIN   AVR32_USART3_TXD_0_0_PIN
 
#define EXAMPLE_USART_TX_FUNCTION   AVR32_USART3_TXD_0_0_FUNCTION
 
#define EXAMPLE_TARGET_DFLL_FREQ_HZ   96000000 /* DFLL target frequency, Hz */
 
#define EXAMPLE_TARGET_MCUCLK_FREQ_HZ   12000000 /* MCU clock target freq, Hz */
 
#define EXAMPLE_TARGET_PBACLK_FREQ_HZ   12000000 /* PBA clock target freq, Hz */
 
#define FPBA   EXAMPLE_TARGET_PBACLK_FREQ_HZ
 
#define EXAMPLE_USART   ( &AVR32_USART1)
 
#define EXAMPLE_USART_RX_PIN   AVR32_USART1_RXD_0_0_PIN
 
#define EXAMPLE_USART_RX_FUNCTION   AVR32_USART1_RXD_0_0_FUNCTION
 
#define EXAMPLE_USART_TX_PIN   AVR32_USART1_TXD_0_0_PIN
 
#define EXAMPLE_USART_TX_FUNCTION   AVR32_USART1_TXD_0_0_FUNCTION
 
#define FPBA   FOSC0
 

Functions

int main (void)
 main function : do init and loop (poll if configured so) More...
 
static char * print_i (char *str, int n)
 print_i function : convert the given number to an ASCII decimal representation. More...
 

Variables

Parameters to pcl_configure_clocks().
static scif_gclk_opt_t gc_dfllif_ref_opt = { SCIF_GCCTRL_SLOWCLOCK, 0, false }
 
static pcl_freq_param_t pcl_dfll_freq_param
 

#define EXAMPLE_TARGET_DFLL_FREQ_HZ   96000000 /* DFLL target frequency, Hz */
#define EXAMPLE_TARGET_MCUCLK_FREQ_HZ   12000000 /* MCU clock target freq, Hz */
#define EXAMPLE_TARGET_PBACLK_FREQ_HZ   12000000 /* PBA clock target freq, Hz */
#define EXAMPLE_USART   (&AVR32_USART2)

Referenced by clock_measure(), and main().

#define EXAMPLE_USART   (&AVR32_USART3)
#define EXAMPLE_USART   ( &AVR32_USART1)
#define EXAMPLE_USART_RX_FUNCTION   AVR32_USART2_RXD_0_1_FUNCTION

Referenced by main().

#define EXAMPLE_USART_RX_FUNCTION   AVR32_USART3_RXD_0_0_FUNCTION
#define EXAMPLE_USART_RX_FUNCTION   AVR32_USART1_RXD_0_0_FUNCTION
#define EXAMPLE_USART_RX_PIN   AVR32_USART2_RXD_0_1_PIN

Referenced by main().

#define EXAMPLE_USART_RX_PIN   AVR32_USART3_RXD_0_0_PIN
#define EXAMPLE_USART_RX_PIN   AVR32_USART1_RXD_0_0_PIN
#define EXAMPLE_USART_TX_FUNCTION   AVR32_USART2_TXD_0_1_FUNCTION

Referenced by main().

#define EXAMPLE_USART_TX_FUNCTION   AVR32_USART3_TXD_0_0_FUNCTION
#define EXAMPLE_USART_TX_FUNCTION   AVR32_USART1_TXD_0_0_FUNCTION
#define EXAMPLE_USART_TX_PIN   AVR32_USART2_TXD_0_1_PIN

Referenced by main().

#define EXAMPLE_USART_TX_PIN   AVR32_USART3_TXD_0_0_PIN
#define EXAMPLE_USART_TX_PIN   AVR32_USART1_TXD_0_0_PIN
#define FPBA   FOSC0

Referenced by main().

#define FPBA   EXAMPLE_TARGET_PBACLK_FREQ_HZ
#define FPBA   FOSC0

static char* print_i ( char *  str,
int  n 
)
static

print_i function : convert the given number to an ASCII decimal representation.

Referenced by main().

scif_gclk_opt_t gc_dfllif_ref_opt = { SCIF_GCCTRL_SLOWCLOCK, 0, false }
static
pcl_freq_param_t pcl_dfll_freq_param
static
Initial value:
= {
.main_clk_src = PCL_MC_DFLL0,
.pextra_params = &gc_dfllif_ref_opt
}
Definition: power_clocks_lib.h:116
#define EXAMPLE_TARGET_DFLL_FREQ_HZ
Definition: ast_example1.c:119
#define EXAMPLE_TARGET_MCUCLK_FREQ_HZ
Definition: ast_example1.c:120
#define EXAMPLE_TARGET_PBACLK_FREQ_HZ
Definition: ast_example1.c:121
static scif_gclk_opt_t gc_dfllif_ref_opt
Definition: ast_example1.c:127

Referenced by main().