#include <stddef.h>
#include <stdio.h>
#include <avr32/io.h>
#include "nlao_cpu.h"
#include "nlao_usart.h"
#include "compiler.h"
#include "board.h"
#include "print_funcs.h"
#include "intc.h"
#include "gpio.h"
#include "pm.h"
#include "flashc.h"
#include "twim.h"
#include "usart.h"
#include "conf_usb.h"
#include "usb_task.h"
#include "device_audio_task.h"
#include "device_hid_task.h"
#include "audio_example.h"
#include "controller.h"
#include "tlv320aic23b.h"
#include "et024006dhu.h"
#include "avr32_logo.h"
Functions | |
int | _init_startup (void) |
Low-level initialization routine called during startup, before the main function. More... | |
static void | init_codec_gclk (void) |
Sets up generic clock for the audio codec. More... | |
static void | init_hmatrix (void) |
Initializes the HSB bus matrix. More... | |
static void | init_stdio (void) |
Initializes STDIO. More... | |
static void | init_sys_clocks (void) |
Initializes the MCU system clocks. More... | |
static void | init_twi (uint32_t fpba_hz) |
static void | init_usb_clock (void) |
Initializes the USB clock. More... | |
int | main (void) |
Main function. Execution starts here. More... | |
int _init_startup | ( | void | ) |
Low-level initialization routine called during startup, before the main function.
This version comes in replacement to the default one provided by the Newlib add-ons library. Newlib add-ons' _init_startup only calls init_exceptions, but Newlib add-ons' exception and interrupt vectors are defined in the same section and Newlib add-ons' interrupt vectors are not compatible with the interrupt management of the INTC module. More low-level initializations are besides added here.
References _evba, cpu_irq_enable, Enable_global_exception, init_stdio(), irq_initialize_vectors, and Set_system_register.
|
static |
Sets up generic clock for the audio codec.
References gpio_enable_module_pin(), pm_gc_enable(), pm_gc_setup(), TLV320_PM_GCLK_FUNCTION, and TLV320_PM_GCLK_PIN.
Referenced by init_sys_clocks().
|
static |
Initializes the HSB bus matrix.
Referenced by main().
|
static |
Initializes STDIO.
References usart_options_t::baudrate, FPBA_HZ, gpio_enable_module(), set_usart_base(), STDIO_USART, STDIO_USART_BAUDRATE, STDIO_USART_RX_FUNCTION, STDIO_USART_RX_PIN, STDIO_USART_TX_FUNCTION, STDIO_USART_TX_PIN, USART_1_STOPBIT, usart_init(), usart_init_rs232(), USART_NO_PARITY, and USART_NORMAL_CHMODE.
Referenced by _init_startup().
|
static |
Initializes the MCU system clocks.
References flashc_set_wait_state(), FMCK_HZ, FOSC0, FOSC1, FPBA_HZ, init_codec_gclk(), init_usb_clock(), OSC0_STARTUP, OSC1_STARTUP, pm_cksel(), pm_enable_clk1(), pm_enable_osc1_crystal(), pm_pll_enable(), pm_pll_set_option(), pm_pll_setup(), pm_switch_to_clock(), pm_switch_to_osc0(), pm_wait_for_pll0_locked(), set_cpu_hz(), and SYS_CLOCK_PLL_MUL.
Referenced by main().
|
static |
References AIC23B_TWI, AIC23B_TWI_ADDRESS, AIC23B_TWI_MASTER_SPEED, AIC23B_TWI_SCL_FUNCTION, AIC23B_TWI_SCL_PIN, AIC23B_TWI_SDA_FUNCTION, AIC23B_TWI_SDA_PIN, gpio_enable_module(), twi_options_t::pba_hz, twi_options_t::speed, TPA6130_TWI, TPA6130_TWI_ADDRESS, TPA6130_TWI_MASTER_SPEED, TPA6130_TWI_SCL_FUNCTION, TPA6130_TWI_SCL_PIN, TPA6130_TWI_SDA_FUNCTION, TPA6130_TWI_SDA_PIN, and twi_master_init().
Referenced by main().
|
static |
int main | ( | void | ) |
Main function. Execution starts here.
42 | Fatal error. |
References AUDIO_DEMO_STRING, audio_mixer_dacs_start, audio_mixer_enable_dacs, avr32_logo, AVR32_LOGO_HEIGHT, AVR32_LOGO_WIDTH, BLACK, controller_init(), DEFAULT_DAC_BITS_PER_SAMPLE, DEFAULT_DAC_NUM_CHANNELS, DEFAULT_DAC_SAMPLE_RATE_HZ, DEFAULT_DAC_SWAP_CHANNELS, DEFAULT_DACS, device_audio_task(), device_audio_task_init(), device_hid_task(), device_hid_task_init(), et024006_DrawFilledRect(), ET024006_HEIGHT, et024006_Init(), et024006_PrintString(), et024006_PutPixmap(), ET024006_WIDTH, ET024006DHU_BL_PIN, FCPU_HZ, FHSB_HZ, FONT8x16, FONT8x8, FOSC0, FPBA_HZ, FPBB_HZ, gpio_set_gpio_pin(), init_hmatrix(), init_sys_clocks(), init_twi(), usb_task(), usb_task_init(), and WHITE.