Microchip® Advanced Software Framework

pdca.h File Reference

PDCA driver for SAM4L.

This file defines a useful set of functions for the PDCA interface on SAM4L devices.

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

#include "compiler.h"

Data Structures

struct  pdca_channel_config_t
 PDCA channel options. More...
 

Typedefs

typedef void(* pdca_callback_t )(enum pdca_channel_status status)
 
typedef uint32_t pdca_channel_interrupt_mask_t
 PDCA channel interrupt mask type. More...
 
typedef uint8_t pdca_channel_num_t
 Number of available PDCA channels, device dependent. More...
 

Enumerations

enum  pdca_channel_status {
  PDCA_CH_FREE = 0,
  PDCA_CH_BUSY,
  PDCA_CH_COUNTER_RELOAD_IS_ZERO,
  PDCA_CH_TRANSFER_COMPLETED,
  PDCA_CH_TRANSFER_ERROR
}
 brief PDCA channel status More...
 

Functions

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

typedef void(* pdca_callback_t)(enum pdca_channel_status status)

PDCA channel interrupt mask type.

typedef uint8_t pdca_channel_num_t

Number of available PDCA channels, device dependent.

PDCA channel number type

brief PDCA channel status

Enumerator
PDCA_CH_FREE 

PDCA channel is disabled.

PDCA_CH_BUSY 

PDCA channel is enabled but transfer is on-going.

PDCA_CH_COUNTER_RELOAD_IS_ZERO 

PDCA channel counter reload is zero.

PDCA_CH_TRANSFER_COMPLETED 

PDCA channel has completed a block transfer.

PDCA_CH_TRANSFER_ERROR 

PDCA channel failed to complete a block transfer.