Microchip® Advanced Software Framework

abdacb_example.c File Reference

Audio Bitstream DAC Example for SAM4L.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "sound.h"

Macros

#define PDCA_ABDAC_CHANNEL0   0
 
#define PDCA_ABDAC_CHANNEL1   1
 
#define SOUND_SAMPLES   0x100
 

Functions

static void config_buttons (void)
 
static void configure_console (void)
 Configure UART console. More...
 
static void display_menu (void)
 Display the user menu on the terminal. More...
 
static void eic_5_callback (void)
 EIC interrupt handler for push button interrupt. More...
 
int main (void)
 Application entry point for ABDAC example. More...
 

Variables

volatile bool exit_flag = false
 
struct abdac_config g_abdac_cfg
 ABDAC configuration. More...
 
struct abdac_dev_inst g_abdac_inst
 ABDAC instance. More...
 
static const pdca_channel_config_t pdca_abdac_config0
 
static const pdca_channel_config_t pdca_abdac_config1
 
int16_t samples_left [SOUND_SAMPLES]
 
int16_t samples_right [SOUND_SAMPLES]
 

#define PDCA_ABDAC_CHANNEL0   0

Referenced by main().

#define PDCA_ABDAC_CHANNEL1   1

Referenced by main().

#define SOUND_SAMPLES   0x100

Referenced by main().

static void configure_console ( void  )
static

Configure UART console.

References uart_rs232_options::baudrate, and stdio_serial_init().

Referenced by main().

static void display_menu ( void  )
static

Display the user menu on the terminal.

Referenced by main().

static void eic_5_callback ( void  )
static

EIC interrupt handler for push button interrupt.

References eic_line_clear_interrupt(), eic_line_interrupt_is_pending(), and exit_flag.

Referenced by config_buttons().

volatile bool exit_flag = false

Referenced by eic_5_callback(), and main().

struct abdac_config g_abdac_cfg

ABDAC configuration.

struct abdac_dev_inst g_abdac_inst

ABDAC instance.

const pdca_channel_config_t pdca_abdac_config0
static
Initial value:
= {
.addr = 0,
.pid = ABDACB_PDCA_ID_TX_CH0,
.size = 0,
.r_addr = 0,
.r_size = 0,
.ring = false,
.transfer_size = PDCA_MR_SIZE_HALF_WORD
}
const pdca_channel_config_t pdca_abdac_config1
static
Initial value:
= {
.addr = 0,
.pid = ABDACB_PDCA_ID_TX_CH1,
.size = 0,
.r_addr = 0,
.r_size = 0,
.ring = false,
.transfer_size = PDCA_MR_SIZE_HALF_WORD
}
int16_t samples_left[SOUND_SAMPLES]

Referenced by main().

int16_t samples_right[SOUND_SAMPLES]

Referenced by main().