Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AUDIO - ABDAC - Audio Bitstream DAC

Audio Bitstream DAC (Digital to Analog Converter) provides functions to convert a 16-bit sample value to a digital bitstream.

For UC3 B, this module is only available in AT32UC3B0512 and AT32UC3B1512.

Macros

#define ABDAC_BF(name, value)
 Bit-field macro for GCLK. More...
 
#define ABDAC_BIT(name)   (1 << AVR32_ABDAC_##name##_OFFSET)
 Bit macro for ABDAC. More...
 
#define ABDAC_GCLK   AVR32_PM_GCLK_ABDAC
 GCLK used by the ABDAC to generate bitstream. More...
 
#define ABDAC_TIMEOUT   5000
 Number of tries before the driver reports timeout. More...
 
#define GCLK_BF(name, value)
 Bit-field macro for ABDAC GCLK. More...
 
#define GCLK_BFEXT(name, value)
 Bit-field extraction macro for ABDAC GCLK. More...
 
#define GCLK_BIT(name)   (1 << AVR32_PM_GCCTRL_##name##_OFFSET)
 Bit macro for ABDAC GCLK. More...
 

Enumerations

enum  {
  EINVAL = 22,
  ETIMEOUT
}
 

Functions

void abdac_disable (volatile avr32_abdac_t *abdac)
 
void abdac_enable (volatile avr32_abdac_t *abdac)
 
unsigned long abdac_get_dac_hz (volatile avr32_abdac_t *abdac, const unsigned long bus_hz)
 
unsigned long abdac_set_dac_hz (volatile avr32_abdac_t *abdac, const unsigned long bus_hz, const unsigned long dac_hz)
 
bool abdac_set_dac_sample_rate (const unsigned long dac_hz)
 
int abdac_sink (volatile avr32_abdac_t *abdac, const unsigned short ch0, const unsigned short ch1)
 
void abdac_swap_channels (volatile avr32_abdac_t *abdac)
 

#define ABDAC_BF (   name,
  value 
)
Value:
(((value) & ((1 << AVR32_ABDAC_##name##_SIZE) - 1)) \
<< AVR32_ABDAC_##name##_OFFSET)
const char * name
The name of the test suite.
Definition: suite.h:200

Bit-field macro for GCLK.

Referenced by abdac_sink().

#define ABDAC_BIT (   name)    (1 << AVR32_ABDAC_##name##_OFFSET)

Bit macro for ABDAC.

Referenced by abdac_disable(), abdac_enable(), abdac_sink(), and abdac_swap_channels().

#define ABDAC_GCLK   AVR32_PM_GCLK_ABDAC

GCLK used by the ABDAC to generate bitstream.

Referenced by abdac_disable(), abdac_enable(), abdac_get_dac_hz(), abdac_set_dac_hz(), and abdac_set_dac_sample_rate().

#define ABDAC_TIMEOUT   5000

Number of tries before the driver reports timeout.

Referenced by abdac_sink().

#define GCLK_BF (   name,
  value 
)
Value:
(((value) & ((1 << AVR32_PM_GCCTRL_##name##_SIZE) - 1))\
<< AVR32_PM_GCCTRL_##name##_OFFSET)
const char * name
The name of the test suite.
Definition: suite.h:200

Bit-field macro for ABDAC GCLK.

#define GCLK_BFEXT (   name,
  value 
)
Value:
(((value) >> AVR32_PM_GCCTRL_##name##_OFFSET) \
& ((1 << AVR32_PM_GCCTRL_##name##_SIZE) - 1))
const char * name
The name of the test suite.
Definition: suite.h:200

Bit-field extraction macro for ABDAC GCLK.

Referenced by abdac_get_dac_hz().

#define GCLK_BIT (   name)    (1 << AVR32_PM_GCCTRL_##name##_OFFSET)

Bit macro for ABDAC GCLK.

Referenced by abdac_disable(), abdac_enable(), and abdac_get_dac_hz().

anonymous enum
Enumerator
EINVAL 
ETIMEOUT 

void abdac_disable ( volatile avr32_abdac_t *  abdac)

References ABDAC_BIT, ABDAC_GCLK, and GCLK_BIT.

Referenced by tpa6130_dac_stop().

void abdac_enable ( volatile avr32_abdac_t *  abdac)

References ABDAC_BIT, ABDAC_GCLK, and GCLK_BIT.

Referenced by tpa6130_dac_setup().

unsigned long abdac_get_dac_hz ( volatile avr32_abdac_t *  abdac,
const unsigned long  bus_hz 
)

References ABDAC_GCLK, GCLK_BFEXT, and GCLK_BIT.

unsigned long abdac_set_dac_hz ( volatile avr32_abdac_t *  abdac,
const unsigned long  bus_hz,
const unsigned long  dac_hz 
)

References ABDAC_GCLK, and EINVAL.

Referenced by tpa6130_dac_setup().

bool abdac_set_dac_sample_rate ( const unsigned long  dac_hz)

References ABDAC_GCLK.

Referenced by tpa6130_dac_setup().

int abdac_sink ( volatile avr32_abdac_t *  abdac,
const unsigned short  ch0,
const unsigned short  ch1 
)
void abdac_swap_channels ( volatile avr32_abdac_t *  abdac)

References ABDAC_BIT.

Referenced by tpa6130_dac_setup().