Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends 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.

Modules

 

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
#define PDCA_TRANSFER_SIZE_HALF_WORD   AVR32_PDCA_HALF_WORD

Size of PDCA transfer: half-word.

Referenced by aic23b_dac_setup(), init_pdca_adc(), and ms3_dac_setup().

#define PDCA_TRANSFER_SIZE_WORD   AVR32_PDCA_WORD

Size of PDCA transfer: word.

Referenced by aic23b_dac_setup(), ms3_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(), ili9341_copy_pixels_to_screen(), ili9341_duplicate_pixel(), ms3_dac_stop(), pdca_int_handler(), tpa6130_dac_flush(), and tpa6130_dac_stop().

void pdca_disable_interrupt_reload_counter_zero ( uint8_t  pdca_ch_number)
void pdca_disable_interrupt_transfer_complete ( uint8_t  pdca_ch_number)
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(), pbuf::flags, 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(), ili9341_copy_pixels_to_screen(), ili9341_duplicate_pixel(), main(), ms3_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(), main(), ms3_dac_mute(), ms3_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(), main(), ms3_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(), and ms3_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(), ms3_dac_flush(), ms3_dac_mute(), ms3_dac_output(), ms3_ssc_tx_pdca_int_handler(), 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(), pbuf::flags, and pdca_get_handler().

Referenced by main(), and 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(), pbuf::flags, and pdca_get_handler().

Referenced by aic23b_dac_output(), ili9341_copy_pixels_to_screen(), ili9341_duplicate_pixel(), main(), ms3_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().

Referenced by ili9341_copy_pixels_to_screen(), and ili9341_duplicate_pixel().

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().

Referenced by ili9341_copy_pixels_to_screen(), and ili9341_duplicate_pixel().