Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
UC3 Peripheral DMA Controller

The Peripheral DMA controller (PDCA) transfers data between on-chip peripheral modules such as USART, SPI, SSC and on- and off-chip memories.

Data Structures

struct  pdca_channel_options_t
 PDCA channel options. More...
 

Macros

#define PDCA_TRANSFER_SIZE_BYTE   AVR32_PDCA_BYTE
 Size of PDCA transfer: byte. More...
 
#define PDCA_TRANSFER_SIZE_HALF_WORD   AVR32_PDCA_HALF_WORD
 Size of PDCA transfer: half-word. More...
 
#define PDCA_TRANSFER_SIZE_WORD   AVR32_PDCA_WORD
 Size of PDCA transfer: word. More...
 

Functions

void pdca_disable (uint8_t pdca_ch_number)
 Disable the PDCA for the given channel. More...
 
void pdca_disable_interrupt_reload_counter_zero (uint8_t pdca_ch_number)
 Disable PDCA transfer interrupt when TCRR reaches zero. More...
 
void pdca_disable_interrupt_transfer_complete (uint8_t pdca_ch_number)
 Disable PDCA transfer interrupt when completed (ie TCR and TCRR are both zero) More...
 
void pdca_disable_interrupt_transfer_error (uint8_t pdca_ch_number)
 Disable PDCA transfer error interrupt. More...
 
void pdca_enable (uint8_t pdca_ch_number)
 Enable the PDCA for the given channel. More...
 
void pdca_enable_interrupt_reload_counter_zero (uint8_t pdca_ch_number)
 Enable PDCA transfer interrupt when TCRR reaches zero. More...
 
void pdca_enable_interrupt_transfer_complete (uint8_t pdca_ch_number)
 Enable PDCA transfer interrupt when completed (ie TCR and TCRR are both zero) More...
 
void pdca_enable_interrupt_transfer_error (uint8_t pdca_ch_number)
 Enable PDCA transfer error interrupt. More...
 
bool pdca_get_channel_status (uint8_t pdca_ch_number)
 Get the PDCA channel transfer enable status. More...
 
volatile avr32_pdca_channel_t * pdca_get_handler (uint8_t pdca_ch_number)
 Get PDCA channel handler. More...
 
uint32_t pdca_get_load_size (uint8_t pdca_ch_number)
 Get PDCA channel load size (or remaining size if transfer started) More...
 
uint32_t pdca_get_reload_size (uint8_t pdca_ch_number)
 Get PDCA channel reload size. More...
 
uint32_t pdca_get_transfer_status (uint8_t pdca_ch_number)
 Get PDCA channel transfer status. More...
 
uint32_t pdca_init_channel (uint8_t pdca_ch_number, const pdca_channel_options_t *opt)
 Set the channel configuration. More...
 
void pdca_load_channel (uint8_t pdca_ch_number, volatile void *addr, uint32_t size)
 Set PDCA channel load values. More...
 
void pdca_reload_channel (uint8_t pdca_ch_number, volatile void *addr, uint32_t size)
 Set PDCA channel reload values. More...
 
void pdca_set_peripheral_select (uint8_t pdca_ch_number, uint32_t pid)
 Set the peripheral function to use with the PDCA channel. More...
 
void pdca_set_transfer_size (uint8_t pdca_ch_number, uint32_t transfer_size)
 Set the size of the transfer. More...
 

PDCA Driver Status Codes

#define PDCA_SUCCESS   0
 
#define PDCA_INVALID_ARGUMENT   -1
 

PDCA Transfer Status Codes

#define PDCA_TRANSFER_ERROR   AVR32_PDCA_TERR_MASK
 
#define PDCA_TRANSFER_COMPLETE   AVR32_PDCA_TRC_MASK
 
#define PDCA_TRANSFER_COUNTER_RELOAD_IS_ZERO   AVR32_PDCA_RCZ_MASK
 

#define PDCA_INVALID_ARGUMENT   -1

Referenced by pdca_get_handler().

#define PDCA_SUCCESS   0

Referenced by pdca_init_channel().

#define PDCA_TRANSFER_COMPLETE   AVR32_PDCA_TRC_MASK
#define PDCA_TRANSFER_COUNTER_RELOAD_IS_ZERO   AVR32_PDCA_RCZ_MASK
#define PDCA_TRANSFER_ERROR   AVR32_PDCA_TERR_MASK
#define PDCA_TRANSFER_SIZE_BYTE   AVR32_PDCA_BYTE

Size of PDCA transfer: byte.

Referenced by aic23b_dac_setup().

#define PDCA_TRANSFER_SIZE_HALF_WORD   AVR32_PDCA_HALF_WORD

Size of PDCA transfer: half-word.

Referenced by aic23b_dac_setup().

#define PDCA_TRANSFER_SIZE_WORD   AVR32_PDCA_WORD

Size of PDCA transfer: word.

Referenced by aic23b_dac_setup(), and tpa6130_dac_setup().

void pdca_disable ( uint8_t  pdca_ch_number)

Disable the PDCA for the given channel.

Parameters
pdca_ch_numberPDCA channel

References pdca_get_handler().

Referenced by aic23b_dac_stop(), tpa6130_dac_flush(), and tpa6130_dac_stop().

void pdca_disable_interrupt_reload_counter_zero ( uint8_t  pdca_ch_number)

Disable PDCA transfer interrupt when TCRR reaches zero.

Parameters
pdca_ch_numberPDCA channel

References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().

Referenced by aic23b_dac_flush(), aic23b_dac_mute(), aic23b_ssc_tx_pdca_int_handler(), ISR(), pdca_init_channel(), tpa6130_dac_flush(), and tpa6130_dac_mute().

void pdca_disable_interrupt_transfer_complete ( uint8_t  pdca_ch_number)

Disable PDCA transfer interrupt when completed (ie TCR and TCRR are both zero)

Parameters
pdca_ch_numberPDCA channel

References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().

Referenced by aic23b_dac_flush(), aic23b_ssc_tx_pdca_int_handler(), ISR(), pdca_init_channel(), and tpa6130_dac_flush().

void pdca_disable_interrupt_transfer_error ( uint8_t  pdca_ch_number)

Disable PDCA transfer error interrupt.

Parameters
pdca_ch_numberPDCA channel

References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().

void pdca_enable ( uint8_t  pdca_ch_number)

Enable the PDCA for the given channel.

Parameters
pdca_ch_numberPDCA channel

References pdca_get_handler().

Referenced by aic23b_dac_setup(), tpa6130_dac_flush(), and tpa6130_dac_setup().

void pdca_enable_interrupt_reload_counter_zero ( uint8_t  pdca_ch_number)

Enable PDCA transfer interrupt when TCRR reaches zero.

Parameters
pdca_ch_numberPDCA channel

References pdca_get_handler().

Referenced by aic23b_dac_mute(), aic23b_dac_output(), tpa6130_dac_mute(), and tpa6130_dac_output().

void pdca_enable_interrupt_transfer_complete ( uint8_t  pdca_ch_number)

Enable PDCA transfer interrupt when completed (ie TCR and TCRR are both zero)

Parameters
pdca_ch_numberPDCA channel

References pdca_get_handler().

Referenced by aic23b_dac_output(), and tpa6130_dac_output().

void pdca_enable_interrupt_transfer_error ( uint8_t  pdca_ch_number)

Enable PDCA transfer error interrupt.

Parameters
pdca_ch_numberPDCA channel

References pdca_get_handler().

bool pdca_get_channel_status ( uint8_t  pdca_ch_number)

Get the PDCA channel transfer enable status.

Parameters
pdca_ch_numberPDCA channel
Returns
true if channel transfer is enabled, else false

References pdca_get_handler().

uint32_t pdca_get_load_size ( uint8_t  pdca_ch_number)

Get PDCA channel load size (or remaining size if transfer started)

Parameters
pdca_ch_numberPDCA channel
Returns
size current size to transfer

References pdca_get_handler().

uint32_t pdca_get_reload_size ( uint8_t  pdca_ch_number)

Get PDCA channel reload size.

Parameters
pdca_ch_numberPDCA channel
Returns
size current reload size

References pdca_get_handler().

Referenced by aic23b_dac_output().

uint32_t pdca_get_transfer_status ( uint8_t  pdca_ch_number)

Get PDCA channel transfer status.

Parameters
pdca_ch_numberPDCA channel
Returns
PDCA transfer status with the following bit-masks:
  • PDCA_TRANSFER_ERROR;
  • PDCA_TRANSFER_COMPLETE;
  • PDCA_TRANSFER_COUNTER_RELOAD_IS_ZERO.

References pdca_get_handler().

Referenced by aic23b_dac_flush(), aic23b_dac_mute(), aic23b_dac_output(), aic23b_ssc_tx_pdca_int_handler(), ISR(), tpa6130_dac_mute(), and tpa6130_dac_output().

void pdca_load_channel ( uint8_t  pdca_ch_number,
volatile void *  addr,
uint32_t  size 
)

Set PDCA channel load values.

Parameters
pdca_ch_numberPDCA channel
addraddress where data to load are stored
sizesize of the data block to load

References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().

Referenced by tpa6130_dac_flush().

void pdca_reload_channel ( uint8_t  pdca_ch_number,
volatile void *  addr,
uint32_t  size 
)

Set PDCA channel reload values.

Parameters
pdca_ch_numberPDCA channel
addraddress where data to load are stored
sizesize of the data block to load

References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().

Referenced by aic23b_dac_output(), tpa6130_dac_flush(), and tpa6130_dac_output().

void pdca_set_peripheral_select ( uint8_t  pdca_ch_number,
uint32_t  pid 
)

Set the peripheral function to use with the PDCA channel.

Parameters
pdca_ch_numberPDCA channel
pidthe peripheral ID

References pdca_get_handler().

void pdca_set_transfer_size ( uint8_t  pdca_ch_number,
uint32_t  transfer_size 
)

Set the size of the transfer.

Parameters
pdca_ch_numberPDCA channel
transfer_sizesize of the transfer (byte, half-word or word)

References pdca_get_handler().