Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Peripheral DMA Controller (PDC)

See Quickstart guide for SAM PDCA driver.

The Peripheral DMA Controller (PDC) transfers data between on-chip serial peripherals and the on- and/or off-chip memories. The link between the PDC and a serial peripheral is operated by the AHB to ABP bridge.

Modules

 
 Quick Start Guide(s)
 In this section you can find a list of all Quick Start guides related to the Peripheral DMA Controller (PDC).
 

Functions

void PDCA_0_Handler (void)
 Interrupt handler for PDCA channel 0. More...
 
void PDCA_10_Handler (void)
 Interrupt handler for PDCA channel 10. More...
 
void PDCA_11_Handler (void)
 Interrupt handler for PDCA channel 11. More...
 
void PDCA_12_Handler (void)
 Interrupt handler for PDCA channel 12. More...
 
void PDCA_13_Handler (void)
 Interrupt handler for PDCA channel 13. More...
 
void PDCA_14_Handler (void)
 Interrupt handler for PDCA channel 14. More...
 
void PDCA_15_Handler (void)
 Interrupt handler for PDCA channel 15. More...
 
void PDCA_1_Handler (void)
 Interrupt handler for PDCA channel 1. More...
 
void PDCA_2_Handler (void)
 Interrupt handler for PDCA channel 2. More...
 
void PDCA_3_Handler (void)
 Interrupt handler for PDCA channel 3. More...
 
void PDCA_4_Handler (void)
 Interrupt handler for PDCA channel 4. More...
 
void PDCA_5_Handler (void)
 Interrupt handler for PDCA channel 5. More...
 
void PDCA_6_Handler (void)
 Interrupt handler for PDCA channel 6. More...
 
void PDCA_7_Handler (void)
 Interrupt handler for PDCA channel 7. More...
 
void PDCA_8_Handler (void)
 Interrupt handler for PDCA channel 8. More...
 
void PDCA_9_Handler (void)
 Interrupt handler for PDCA channel 9. More...
 
void pdca_channel_clear_error (pdca_channel_num_t pdca_ch_number)
 Clear transfer error for the given channel. More...
 
void pdca_channel_disable (pdca_channel_num_t pdca_ch_number)
 Disable the PDCA for the given channel. More...
 
void pdca_channel_disable_interrupt (pdca_channel_num_t pdca_ch_number, const pdca_channel_interrupt_mask_t pdca_channel_interrupt_mask)
 Disable PDCA interrupt. More...
 
void pdca_channel_enable (pdca_channel_num_t pdca_ch_number)
 Enable the PDCA for the given channel. More...
 
void pdca_channel_enable_interrupt (pdca_channel_num_t pdca_ch_number, const pdca_channel_interrupt_mask_t pdca_channel_interrupt_mask)
 Enable PDCA transfer error interrupt. More...
 
volatile PdcaChannel * pdca_channel_get_handler (pdca_channel_num_t pdca_ch_number)
 Get PDCA channel handler. More...
 
pdca_channel_interrupt_mask_t pdca_channel_get_interrupt_mask (pdca_channel_num_t pdca_ch_number)
 Get PDCA interrupt mask. More...
 
static void pdca_channel_interrupt (const pdca_channel_num_t pdca_ch_number)
 Common PDCA channel interrupt handler. More...
 
bool pdca_channel_is_enabled (pdca_channel_num_t pdca_ch_number)
 Check if PDCA channel is enabled. More...
 
uint32_t pdca_channel_read_load_size (pdca_channel_num_t pdca_ch_number)
 Read PDCA channel load values from hardware. More...
 
uint32_t pdca_channel_read_reload_size (pdca_channel_num_t pdca_ch_number)
 Read PDCA channel reload values from hardware. More...
 
void pdca_channel_set_callback (pdca_channel_num_t pdca_ch_number, pdca_callback_t callback, uint8_t irq_line, uint8_t irq_level, const pdca_channel_interrupt_mask_t pdca_channel_interrupt_mask)
 Set callback for given PDCA channel. More...
 
void pdca_channel_set_config (pdca_channel_num_t pdca_ch_number, const pdca_channel_config_t *cfg)
 Write PDCA channel configuration to hardware. More...
 
void pdca_channel_write_load (pdca_channel_num_t pdca_ch_number, volatile void *addr, uint32_t size)
 Write PDCA channel load values to hardware. More...
 
void pdca_channel_write_reload (pdca_channel_num_t pdca_ch_number, volatile void *addr, uint32_t size)
 Write PDCA channel reload values to hardware. More...
 
void pdca_disable (Pdca *pdca)
 Disable the PDCA module. More...
 
void pdca_enable (Pdca *pdca)
 Disable the PDCA module. More...
 
enum pdca_channel_status pdca_get_channel_status (pdca_channel_num_t pdca_ch_number)
 Get the PDCA channel transfer enable status. More...
 

Variables

pdca_callback_t pdca_callback_pointer [PDCA_NUMBER_OF_CHANNELS]
 PDCA private data for each channel. More...
 

void PDCA_0_Handler ( void  )

Interrupt handler for PDCA channel 0.

References pdca_channel_interrupt().

void PDCA_10_Handler ( void  )

Interrupt handler for PDCA channel 10.

References pdca_channel_interrupt().

void PDCA_11_Handler ( void  )

Interrupt handler for PDCA channel 11.

References pdca_channel_interrupt().

void PDCA_12_Handler ( void  )

Interrupt handler for PDCA channel 12.

References pdca_channel_interrupt().

void PDCA_13_Handler ( void  )

Interrupt handler for PDCA channel 13.

References pdca_channel_interrupt().

void PDCA_14_Handler ( void  )

Interrupt handler for PDCA channel 14.

References pdca_channel_interrupt().

void PDCA_15_Handler ( void  )

Interrupt handler for PDCA channel 15.

References pdca_channel_interrupt().

void PDCA_1_Handler ( void  )

Interrupt handler for PDCA channel 1.

References pdca_channel_interrupt().

void PDCA_2_Handler ( void  )

Interrupt handler for PDCA channel 2.

References pdca_channel_interrupt().

void PDCA_3_Handler ( void  )

Interrupt handler for PDCA channel 3.

References pdca_channel_interrupt().

void PDCA_4_Handler ( void  )

Interrupt handler for PDCA channel 4.

References pdca_channel_interrupt().

void PDCA_5_Handler ( void  )

Interrupt handler for PDCA channel 5.

References pdca_channel_interrupt().

void PDCA_6_Handler ( void  )

Interrupt handler for PDCA channel 6.

References pdca_channel_interrupt().

void PDCA_7_Handler ( void  )

Interrupt handler for PDCA channel 7.

References pdca_channel_interrupt().

void PDCA_8_Handler ( void  )

Interrupt handler for PDCA channel 8.

References pdca_channel_interrupt().

void PDCA_9_Handler ( void  )

Interrupt handler for PDCA channel 9.

References pdca_channel_interrupt().

void pdca_channel_clear_error ( pdca_channel_num_t  pdca_ch_number)

Clear transfer error for the given channel.

Parameters
pdca_ch_numberPDCA channel

References pdca_channel_get_handler().

void pdca_channel_disable ( pdca_channel_num_t  pdca_ch_number)

Disable the PDCA for the given channel.

Parameters
pdca_ch_numberPDCA channel

References pdca_channel_get_handler().

Referenced by ecb_mode_test_pdca(), lcdca_automated_char_stop(), pdca_parc_callback(), run_ecb_mode_test_pdca(), and run_iis_test().

void pdca_channel_disable_interrupt ( pdca_channel_num_t  pdca_ch_number,
const pdca_channel_interrupt_mask_t  pdca_channel_interrupt_mask 
)

Disable PDCA interrupt.

Parameters
pdca_ch_numberPDCA channel
pdca_channel_interrupt_maskInterrupts to be disabled.

References pdca_channel_get_handler().

Referenced by pdca_parc_callback(), PDCA_RX_Handler(), pdca_transfer_done(), PDCA_TX_Handler(), and start_adc().

void pdca_channel_enable ( pdca_channel_num_t  pdca_ch_number)
void pdca_channel_enable_interrupt ( pdca_channel_num_t  pdca_ch_number,
const pdca_channel_interrupt_mask_t  pdca_channel_interrupt_mask 
)

Enable PDCA transfer error interrupt.

Parameters
pdca_ch_numberPDCA channel
pdca_channel_interrupt_maskInterrupts to be enabled.

References pdca_channel_get_handler().

Referenced by pdca_channel_set_callback().

pdca_channel_interrupt_mask_t pdca_channel_get_interrupt_mask ( pdca_channel_num_t  pdca_ch_number)

Get PDCA interrupt mask.

Parameters
pdca_ch_numberPDCA channel

References pdca_channel_get_handler().

static void pdca_channel_interrupt ( const pdca_channel_num_t  pdca_ch_number)
static

Common PDCA channel interrupt handler.

Calls the channel callback with the channel status code. The following status codes are possible:

  • DMA_CH_TRANSFER_COMPLETED: Transfer completed successfully
  • DMA_CH_TRANSFER_ERROR: Fault in transfer

The optional callback used by the interrupt handler is set by the pdca_channel_set_callback() function.

Parameters
pdca_ch_numberPDCA channel number to handle interrupt for

References Assert, pdca_get_channel_status(), and status.

Referenced by PDCA_0_Handler(), PDCA_10_Handler(), PDCA_11_Handler(), PDCA_12_Handler(), PDCA_13_Handler(), PDCA_14_Handler(), PDCA_15_Handler(), PDCA_1_Handler(), PDCA_2_Handler(), PDCA_3_Handler(), PDCA_4_Handler(), PDCA_5_Handler(), PDCA_6_Handler(), PDCA_7_Handler(), PDCA_8_Handler(), and PDCA_9_Handler().

bool pdca_channel_is_enabled ( pdca_channel_num_t  pdca_ch_number)

Check if PDCA channel is enabled.

Parameters
pdca_ch_numberPDCA channel number to query
Return values
truePDCA channel is enabled
falsePDCA channel is disabled

References pdca_channel_get_handler(), and status.

uint32_t pdca_channel_read_load_size ( pdca_channel_num_t  pdca_ch_number)

Read PDCA channel load values from hardware.

Parameters
pdca_ch_numberPDCA channel
Returns
size of the data block to load

References pdca_channel_get_handler().

Referenced by TC00_Handler().

uint32_t pdca_channel_read_reload_size ( pdca_channel_num_t  pdca_ch_number)

Read PDCA channel reload values from hardware.

Parameters
pdca_ch_numberPDCA channel
Returns
size of the data block to reload

References pdca_channel_get_handler().

Referenced by TC00_Handler().

void pdca_channel_set_callback ( pdca_channel_num_t  pdca_ch_number,
pdca_callback_t  callback,
uint8_t  irq_line,
uint8_t  irq_level,
const pdca_channel_interrupt_mask_t  pdca_channel_interrupt_mask 
)

Set callback for given PDCA channel.

Parameters
pdca_ch_numberPDCA channel number
callbackcallback function pointer
irq_lineinterrupt line.
irq_levelinterrupt level.
pdca_channel_interrupt_maskInterrupts to be enabled.

References callback, irq_register_handler, and pdca_channel_enable_interrupt().

Referenced by init_pdca(), main(), run_adcife_multichannel_test(), and start_adc().

void pdca_channel_write_load ( pdca_channel_num_t  pdca_ch_number,
volatile void *  addr,
uint32_t  size 
)

Write PDCA channel load values to hardware.

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

References pdca_channel_get_handler().

Referenced by main(), pdca_transfer_done(), run_iis_test(), TC00_Handler(), and USART_Handler().

void pdca_channel_write_reload ( pdca_channel_num_t  pdca_ch_number,
volatile void *  addr,
uint32_t  size 
)

Write PDCA channel reload values to hardware.

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

References pdca_channel_get_handler().

Referenced by lcdca_automated_char_reload(), main(), pdca_tranfer_done(), TC00_Handler(), and USART_Handler().

void pdca_disable ( Pdca *  pdca)

Disable the PDCA module.

Parameters
pdcaBase address of the PDCA module

References SLEEPMGR_BACKUP, sleepmgr_unlock_mode(), and sysclk_disable_peripheral_clock().

Referenced by ecb_mode_test_pdca(), run_ecb_mode_test_pdca(), and run_iis_test().

void pdca_enable ( Pdca *  pdca)
enum pdca_channel_status pdca_get_channel_status ( pdca_channel_num_t  pdca_ch_number)

Get the PDCA channel transfer enable status.

Parameters
pdca_ch_numberPDCA channel
Returns
1 if channel transfer is enabled, else 0

References intflag, PDCA_CH_BUSY, PDCA_CH_COUNTER_RELOAD_IS_ZERO, PDCA_CH_FREE, PDCA_CH_TRANSFER_COMPLETED, PDCA_CH_TRANSFER_ERROR, pdca_channel_get_handler(), and status.

Referenced by aes_callback_pdca(), main(), pdca_channel_interrupt(), read_test_pdca(), run_iis_test(), and write_test_pdca().

pdca_callback_t pdca_callback_pointer[PDCA_NUMBER_OF_CHANNELS]

PDCA private data for each channel.