Microchip® Advanced Software Framework

abdacb.h File Reference

ABDAC driver for SAM.

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

#include "compiler.h"
#include "status_codes.h"

Data Structures

struct  abdac_config
 Configuration setting structure. More...
 
struct  abdac_dev_inst
 ABDAC driver software instance structure. More...
 

Macros

#define ABDAC_BUSY_TIMEOUT   10000
 

Typedefs

typedef void(* abdac_callback_t )(void)
 Interrupt callback function type for ABDAC. More...
 
typedef enum abdac_interrupt_source abdac_interrupt_source_t
 Interrupt sources. More...
 

Enumerations

enum  abdac_data_format {
  ABDAC_DATE_32BIT = 0,
  ABDAC_DATE_20BIT,
  ABDAC_DATE_18BIT,
  ABDAC_DATE_16BIT,
  ABDAC_DATE_16BIT_COMPACT,
  ABDAC_DATE_8BIT,
  ABDAC_DATE_8BIT_COMPACT
}
 Data format of the SDR register value. More...
 
enum  abdac_interrupt_source {
  ABDAC_INTERRUPT_TXRDY = 0,
  ABDAC_INTERRUPT_TXUR
}
 Interrupt sources. More...
 
enum  abdac_sample_rate {
  ABDAC_SAMPLE_RATE_8000 = 0,
  ABDAC_SAMPLE_RATE_11025,
  ABDAC_SAMPLE_RATE_12000,
  ABDAC_SAMPLE_RATE_16000,
  ABDAC_SAMPLE_RATE_22050,
  ABDAC_SAMPLE_RATE_24000,
  ABDAC_SAMPLE_RATE_32000,
  ABDAC_SAMPLE_RATE_44100,
  ABDAC_SAMPLE_RATE_48000
}
 Supported sample rate. More...
 

Functions

void abdac_clear_interrupt_flag (struct abdac_dev_inst *const dev_inst, abdac_interrupt_source_t source)
 Clear the interrupt status. More...
 
status_code_t abdac_disable (struct abdac_dev_inst *const dev_inst)
 Disable the ABDAC module. More...
 
void abdac_disable_interrupt (struct abdac_dev_inst *const dev_inst, abdac_interrupt_source_t source)
 Disable the interrupt. More...
 
status_code_t abdac_enable (struct abdac_dev_inst *const dev_inst)
 Enable the ABDAC module. More...
 
void abdac_enable_interrupt (struct abdac_dev_inst *const dev_inst, abdac_interrupt_source_t source)
 Enable the interrupt. More...
 
void abdac_get_config_defaults (struct abdac_config *const cfg)
 Initialize a ABDAC configuration structure to defaults. More...
 
status_code_t abdac_init (struct abdac_dev_inst *const dev_inst, Abdacb *const abdac, struct abdac_config *const cfg)
 Initialize the ABDAC module. More...
 
static bool abdac_is_busy (struct abdac_dev_inst *const dev_inst)
 Check the busy status of ABDAC. More...
 
static bool abdac_is_tx_ready (struct abdac_dev_inst *const dev_inst)
 Check the transmit ready status of ABDAC. More...
 
static bool abdac_is_tx_underrun (struct abdac_dev_inst *const dev_inst)
 Check the transmit underrun status of ABDAC. More...
 
static uint32_t abdac_read_interrupt_mask (struct abdac_dev_inst *const dev_inst)
 Return the ABDAC interrupts mask value. More...
 
void abdac_set_callback (struct abdac_dev_inst *const dev_inst, abdac_interrupt_source_t source, abdac_callback_t callback, uint8_t irq_level)
 Set callback for ABDAC. More...
 
status_code_t abdac_set_config (struct abdac_dev_inst *const dev_inst)
 Configure the ABDAC module. More...
 
void abdac_set_volume0 (struct abdac_dev_inst *const dev_inst, bool mute, uint32_t volume)
 Set the volume of channel 0. More...
 
void abdac_set_volume1 (struct abdac_dev_inst *const dev_inst, bool mute, uint32_t volume)
 Set the volume of channel 1. More...
 
status_code_t abdac_sw_reset (struct abdac_dev_inst *const dev_inst)
 Software reset the ABDAC module. More...
 
status_code_t abdac_swap_channels (struct abdac_dev_inst *const dev_inst)
 Swap the ABDAC channel output. More...
 
status_code_t abdac_write_data0 (struct abdac_dev_inst *const dev_inst, uint32_t data)
 Writes the data to SDR0. More...
 
status_code_t abdac_write_data1 (struct abdac_dev_inst *const dev_inst, uint32_t data)
 Writes the data to SDR1. More...