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 |
Referenced by ISR(), and tpa6130_dac_mute().
#define PDCA_TRANSFER_COUNTER_RELOAD_IS_ZERO AVR32_PDCA_RCZ_MASK |
Referenced by ISR(), and tpa6130_dac_output().
#define PDCA_TRANSFER_ERROR AVR32_PDCA_TERR_MASK |
#define PDCA_TRANSFER_SIZE_BYTE AVR32_PDCA_BYTE |
Size of PDCA transfer: byte.
#define PDCA_TRANSFER_SIZE_HALF_WORD AVR32_PDCA_HALF_WORD |
Size of PDCA transfer: half-word.
#define PDCA_TRANSFER_SIZE_WORD AVR32_PDCA_WORD |
Size of PDCA transfer: word.
Referenced by tpa6130_dac_setup().
void pdca_disable | ( | uint8_t | pdca_ch_number | ) |
Disable the PDCA for the given channel.
pdca_ch_number | PDCA channel |
References pdca_get_handler().
Referenced by 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.
pdca_ch_number | PDCA channel |
References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().
Referenced by 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)
pdca_ch_number | PDCA channel |
References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().
Referenced by ISR(), pdca_init_channel(), and tpa6130_dac_flush().
void pdca_disable_interrupt_transfer_error | ( | uint8_t | pdca_ch_number | ) |
Disable PDCA transfer error interrupt.
pdca_ch_number | PDCA 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.
pdca_ch_number | PDCA channel |
References pdca_get_handler().
Referenced by 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.
pdca_ch_number | PDCA channel |
References pdca_get_handler().
Referenced by 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)
pdca_ch_number | PDCA channel |
References pdca_get_handler().
Referenced by tpa6130_dac_output().
void pdca_enable_interrupt_transfer_error | ( | uint8_t | pdca_ch_number | ) |
Enable PDCA transfer error interrupt.
pdca_ch_number | PDCA channel |
References pdca_get_handler().
bool pdca_get_channel_status | ( | uint8_t | pdca_ch_number | ) |
Get the PDCA channel transfer enable status.
pdca_ch_number | PDCA channel |
true
if channel transfer is enabled, else false
References pdca_get_handler().
volatile avr32_pdca_channel_t* pdca_get_handler | ( | uint8_t | pdca_ch_number | ) |
Get PDCA channel handler.
pdca_ch_number | PDCA channel |
References PDCA_INVALID_ARGUMENT.
Referenced by pdca_disable(), pdca_disable_interrupt_reload_counter_zero(), pdca_disable_interrupt_transfer_complete(), pdca_disable_interrupt_transfer_error(), pdca_enable(), pdca_enable_interrupt_reload_counter_zero(), pdca_enable_interrupt_transfer_complete(), pdca_enable_interrupt_transfer_error(), pdca_get_channel_status(), pdca_get_load_size(), pdca_get_reload_size(), pdca_get_transfer_status(), pdca_init_channel(), pdca_load_channel(), pdca_reload_channel(), pdca_set_peripheral_select(), and pdca_set_transfer_size().
uint32_t pdca_get_load_size | ( | uint8_t | pdca_ch_number | ) |
Get PDCA channel load size (or remaining size if transfer started)
pdca_ch_number | PDCA channel |
References pdca_get_handler().
uint32_t pdca_get_reload_size | ( | uint8_t | pdca_ch_number | ) |
Get PDCA channel reload size.
pdca_ch_number | PDCA channel |
References pdca_get_handler().
uint32_t pdca_get_transfer_status | ( | uint8_t | pdca_ch_number | ) |
Get PDCA channel transfer status.
pdca_ch_number | PDCA channel |
PDCA_TRANSFER_ERROR
;PDCA_TRANSFER_COMPLETE
;PDCA_TRANSFER_COUNTER_RELOAD_IS_ZERO
. References pdca_get_handler().
Referenced by ISR(), tpa6130_dac_mute(), and tpa6130_dac_output().
uint32_t pdca_init_channel | ( | uint8_t | pdca_ch_number, |
const pdca_channel_options_t * | opt | ||
) |
Set the channel configuration.
pdca_ch_number | PDCA channel |
opt | channel option |
References pdca_channel_options_t::addr, cpu_irq_restore(), cpu_irq_save(), pdca_disable_interrupt_reload_counter_zero(), pdca_disable_interrupt_transfer_complete(), pdca_get_handler(), PDCA_SUCCESS, pdca_channel_options_t::pid, pdca_channel_options_t::r_addr, pdca_channel_options_t::r_size, pdca_channel_options_t::size, and pdca_channel_options_t::transfer_size.
Referenced by tpa6130_dac_setup().
void pdca_load_channel | ( | uint8_t | pdca_ch_number, |
volatile void * | addr, | ||
uint32_t | size | ||
) |
Set PDCA channel load values.
pdca_ch_number | PDCA channel |
addr | address where data to load are stored |
size | size 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.
pdca_ch_number | PDCA channel |
addr | address where data to load are stored |
size | size of the data block to load |
References cpu_irq_restore(), cpu_irq_save(), and pdca_get_handler().
Referenced by 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.
pdca_ch_number | PDCA channel |
pid | the 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.
pdca_ch_number | PDCA channel |
transfer_size | size of the transfer (byte, half-word or word) |
References pdca_get_handler().