Mouse code for the MacroRat
mbed-dev/targets/TARGET_Atmel/TARGET_SAM_CortexM4/drivers/pdc/pdc.h@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /** |
sahilmgandhi | 18:6a4db94011d3 | 2 | * \file |
sahilmgandhi | 18:6a4db94011d3 | 3 | * |
sahilmgandhi | 18:6a4db94011d3 | 4 | * \brief SAM Peripheral DMA Controller (PDC) driver. |
sahilmgandhi | 18:6a4db94011d3 | 5 | * |
sahilmgandhi | 18:6a4db94011d3 | 6 | * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. |
sahilmgandhi | 18:6a4db94011d3 | 7 | * |
sahilmgandhi | 18:6a4db94011d3 | 8 | * \asf_license_start |
sahilmgandhi | 18:6a4db94011d3 | 9 | * |
sahilmgandhi | 18:6a4db94011d3 | 10 | * \page License |
sahilmgandhi | 18:6a4db94011d3 | 11 | * |
sahilmgandhi | 18:6a4db94011d3 | 12 | * Redistribution and use in source and binary forms, with or without |
sahilmgandhi | 18:6a4db94011d3 | 13 | * modification, are permitted provided that the following conditions are met: |
sahilmgandhi | 18:6a4db94011d3 | 14 | * |
sahilmgandhi | 18:6a4db94011d3 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 16 | * this list of conditions and the following disclaimer. |
sahilmgandhi | 18:6a4db94011d3 | 17 | * |
sahilmgandhi | 18:6a4db94011d3 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 19 | * this list of conditions and the following disclaimer in the documentation |
sahilmgandhi | 18:6a4db94011d3 | 20 | * and/or other materials provided with the distribution. |
sahilmgandhi | 18:6a4db94011d3 | 21 | * |
sahilmgandhi | 18:6a4db94011d3 | 22 | * 3. The name of Atmel may not be used to endorse or promote products derived |
sahilmgandhi | 18:6a4db94011d3 | 23 | * from this software without specific prior written permission. |
sahilmgandhi | 18:6a4db94011d3 | 24 | * |
sahilmgandhi | 18:6a4db94011d3 | 25 | * 4. This software may only be redistributed and used in connection with an |
sahilmgandhi | 18:6a4db94011d3 | 26 | * Atmel microcontroller product. |
sahilmgandhi | 18:6a4db94011d3 | 27 | * |
sahilmgandhi | 18:6a4db94011d3 | 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED |
sahilmgandhi | 18:6a4db94011d3 | 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
sahilmgandhi | 18:6a4db94011d3 | 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE |
sahilmgandhi | 18:6a4db94011d3 | 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR |
sahilmgandhi | 18:6a4db94011d3 | 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
sahilmgandhi | 18:6a4db94011d3 | 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
sahilmgandhi | 18:6a4db94011d3 | 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
sahilmgandhi | 18:6a4db94011d3 | 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
sahilmgandhi | 18:6a4db94011d3 | 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
sahilmgandhi | 18:6a4db94011d3 | 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
sahilmgandhi | 18:6a4db94011d3 | 38 | * POSSIBILITY OF SUCH DAMAGE. |
sahilmgandhi | 18:6a4db94011d3 | 39 | * |
sahilmgandhi | 18:6a4db94011d3 | 40 | * \asf_license_stop |
sahilmgandhi | 18:6a4db94011d3 | 41 | * |
sahilmgandhi | 18:6a4db94011d3 | 42 | */ |
sahilmgandhi | 18:6a4db94011d3 | 43 | /* |
sahilmgandhi | 18:6a4db94011d3 | 44 | * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> |
sahilmgandhi | 18:6a4db94011d3 | 45 | */ |
sahilmgandhi | 18:6a4db94011d3 | 46 | |
sahilmgandhi | 18:6a4db94011d3 | 47 | #ifndef PDC_H_INCLUDED |
sahilmgandhi | 18:6a4db94011d3 | 48 | #define PDC_H_INCLUDED |
sahilmgandhi | 18:6a4db94011d3 | 49 | |
sahilmgandhi | 18:6a4db94011d3 | 50 | /** |
sahilmgandhi | 18:6a4db94011d3 | 51 | * \defgroup asfdoc_sam_drivers_pdc_group SAM3A/3N/3S/3U/3X/4E/4N/4S/G Peripheral DMA Controller (PDC) Driver |
sahilmgandhi | 18:6a4db94011d3 | 52 | * This driver for Atmel® | SMART ARM®-based microcontrollers provides |
sahilmgandhi | 18:6a4db94011d3 | 53 | * an interface for the configuration and management of the the Peripheral |
sahilmgandhi | 18:6a4db94011d3 | 54 | * Direct Memory Access (DMA) Controller (PDC) module. |
sahilmgandhi | 18:6a4db94011d3 | 55 | * |
sahilmgandhi | 18:6a4db94011d3 | 56 | * The PDC transfers data between on-chip serial peripherals and the on and/or |
sahilmgandhi | 18:6a4db94011d3 | 57 | * off-chip memories. The link between the PDC and a serial peripheral is |
sahilmgandhi | 18:6a4db94011d3 | 58 | * operated by the AHB to ABP bridge. |
sahilmgandhi | 18:6a4db94011d3 | 59 | * |
sahilmgandhi | 18:6a4db94011d3 | 60 | * This module: |
sahilmgandhi | 18:6a4db94011d3 | 61 | * - Performs transfers to/from APB communication serial peripherals |
sahilmgandhi | 18:6a4db94011d3 | 62 | * - Supports half-duplex and full-duplex peripherals |
sahilmgandhi | 18:6a4db94011d3 | 63 | * |
sahilmgandhi | 18:6a4db94011d3 | 64 | * Devices from the following series can use this module: |
sahilmgandhi | 18:6a4db94011d3 | 65 | * - Atmel | SMART SAM3A |
sahilmgandhi | 18:6a4db94011d3 | 66 | * - Atmel | SMART SAM3N |
sahilmgandhi | 18:6a4db94011d3 | 67 | * - Atmel | SMART SAM3S |
sahilmgandhi | 18:6a4db94011d3 | 68 | * - Atmel | SMART SAM3U |
sahilmgandhi | 18:6a4db94011d3 | 69 | * - Atmel | SMART SAM3X |
sahilmgandhi | 18:6a4db94011d3 | 70 | * - Atmel | SMART SAM4E |
sahilmgandhi | 18:6a4db94011d3 | 71 | * - Atmel | SMART SAM4N |
sahilmgandhi | 18:6a4db94011d3 | 72 | * - Atmel | SMART SAM4S |
sahilmgandhi | 18:6a4db94011d3 | 73 | * - Atmel | SMART SAM G |
sahilmgandhi | 18:6a4db94011d3 | 74 | * |
sahilmgandhi | 18:6a4db94011d3 | 75 | * The outline of this documentation is as follows: |
sahilmgandhi | 18:6a4db94011d3 | 76 | * - \ref asfdoc_sam_drivers_pdc_prerequisites |
sahilmgandhi | 18:6a4db94011d3 | 77 | * - \ref asfdoc_sam_drivers_pdc_module_overview |
sahilmgandhi | 18:6a4db94011d3 | 78 | * - \ref asfdoc_sam_drivers_pdc_special_considerations |
sahilmgandhi | 18:6a4db94011d3 | 79 | * - \ref asfdoc_sam_drivers_pdc_extra_info |
sahilmgandhi | 18:6a4db94011d3 | 80 | * - \ref asfdoc_sam_drivers_pdc_examples |
sahilmgandhi | 18:6a4db94011d3 | 81 | * - \ref asfdoc_sam_drivers_pdc_api_overview |
sahilmgandhi | 18:6a4db94011d3 | 82 | * |
sahilmgandhi | 18:6a4db94011d3 | 83 | * |
sahilmgandhi | 18:6a4db94011d3 | 84 | * \section asfdoc_sam_drivers_pdc_prerequisites Prerequisites |
sahilmgandhi | 18:6a4db94011d3 | 85 | * |
sahilmgandhi | 18:6a4db94011d3 | 86 | * There are no prerequisites for this module. |
sahilmgandhi | 18:6a4db94011d3 | 87 | * |
sahilmgandhi | 18:6a4db94011d3 | 88 | * |
sahilmgandhi | 18:6a4db94011d3 | 89 | * \section asfdoc_sam_drivers_pdc_module_overview Module Overview |
sahilmgandhi | 18:6a4db94011d3 | 90 | * The user interface of each PDC channel is integrated into the user interface |
sahilmgandhi | 18:6a4db94011d3 | 91 | * of the peripheral it serves. The user interface of unidirectional channels |
sahilmgandhi | 18:6a4db94011d3 | 92 | * (receive only or transmit only), contains two 32-bit memory pointers and |
sahilmgandhi | 18:6a4db94011d3 | 93 | * two 16-bit counters, one set (pointer, counter) for current transfer and |
sahilmgandhi | 18:6a4db94011d3 | 94 | * one set (pointer, counter) for next transfer. The bidirectional channel |
sahilmgandhi | 18:6a4db94011d3 | 95 | * user interface contains four 32-bit memory pointers and four 16-bit counters. |
sahilmgandhi | 18:6a4db94011d3 | 96 | * Each set (pointer, counter) is used by current transmit, next transmit, |
sahilmgandhi | 18:6a4db94011d3 | 97 | * current receive and next receive. Using the PDC removes processor overhead |
sahilmgandhi | 18:6a4db94011d3 | 98 | * by reducing its intervention during the transfer. This significantly reduces |
sahilmgandhi | 18:6a4db94011d3 | 99 | * the number of clock cycles required for a data transfer, which improves |
sahilmgandhi | 18:6a4db94011d3 | 100 | * microcontroller performance. To launch a transfer, the peripheral triggers |
sahilmgandhi | 18:6a4db94011d3 | 101 | * its associated PDC channels by using transmit and receive signals. |
sahilmgandhi | 18:6a4db94011d3 | 102 | * When the programmed data is transferred, an end of transfer interrupt is |
sahilmgandhi | 18:6a4db94011d3 | 103 | * generated by the peripheral itself. |
sahilmgandhi | 18:6a4db94011d3 | 104 | * |
sahilmgandhi | 18:6a4db94011d3 | 105 | * \section asfdoc_sam_drivers_pdc_special_considerations Special Considerations |
sahilmgandhi | 18:6a4db94011d3 | 106 | * There are no special considerations for this module. |
sahilmgandhi | 18:6a4db94011d3 | 107 | * |
sahilmgandhi | 18:6a4db94011d3 | 108 | * |
sahilmgandhi | 18:6a4db94011d3 | 109 | * \section asfdoc_sam_drivers_pdc_extra_info Extra Information |
sahilmgandhi | 18:6a4db94011d3 | 110 | |
sahilmgandhi | 18:6a4db94011d3 | 111 | * For extra information, see \ref asfdoc_sam_drivers_pdc_extra. This includes: |
sahilmgandhi | 18:6a4db94011d3 | 112 | * - \ref asfdoc_sam_drivers_pdc_extra_acronyms |
sahilmgandhi | 18:6a4db94011d3 | 113 | * - \ref asfdoc_sam_drivers_pdc_extra_dependencies |
sahilmgandhi | 18:6a4db94011d3 | 114 | * - \ref asfdoc_sam_drivers_pdc_extra_errata |
sahilmgandhi | 18:6a4db94011d3 | 115 | * - \ref asfdoc_sam_drivers_pdc_extra_history |
sahilmgandhi | 18:6a4db94011d3 | 116 | * |
sahilmgandhi | 18:6a4db94011d3 | 117 | * \section asfdoc_sam_drivers_pdc_examples Examples |
sahilmgandhi | 18:6a4db94011d3 | 118 | * |
sahilmgandhi | 18:6a4db94011d3 | 119 | * For a list of examples related to this driver, see |
sahilmgandhi | 18:6a4db94011d3 | 120 | * \ref asfdoc_sam_drivers_pdc_exqsg. |
sahilmgandhi | 18:6a4db94011d3 | 121 | * |
sahilmgandhi | 18:6a4db94011d3 | 122 | * |
sahilmgandhi | 18:6a4db94011d3 | 123 | * \section asfdoc_sam_drivers_pdc_api_overview API Overview |
sahilmgandhi | 18:6a4db94011d3 | 124 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 125 | */ |
sahilmgandhi | 18:6a4db94011d3 | 126 | |
sahilmgandhi | 18:6a4db94011d3 | 127 | #include <compiler.h> |
sahilmgandhi | 18:6a4db94011d3 | 128 | |
sahilmgandhi | 18:6a4db94011d3 | 129 | /// @cond |
sahilmgandhi | 18:6a4db94011d3 | 130 | /**INDENT-OFF**/ |
sahilmgandhi | 18:6a4db94011d3 | 131 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 132 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 133 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 134 | /**INDENT-ON**/ |
sahilmgandhi | 18:6a4db94011d3 | 135 | /// @endcond |
sahilmgandhi | 18:6a4db94011d3 | 136 | |
sahilmgandhi | 18:6a4db94011d3 | 137 | /** |
sahilmgandhi | 18:6a4db94011d3 | 138 | * \brief PDC data packet for transfer. |
sahilmgandhi | 18:6a4db94011d3 | 139 | */ |
sahilmgandhi | 18:6a4db94011d3 | 140 | typedef struct pdc_packet { |
sahilmgandhi | 18:6a4db94011d3 | 141 | /** Start address of the transfer packet data. */ |
sahilmgandhi | 18:6a4db94011d3 | 142 | uint32_t ul_addr; |
sahilmgandhi | 18:6a4db94011d3 | 143 | /** Transfer packet size (in units of the peripheral data width). */ |
sahilmgandhi | 18:6a4db94011d3 | 144 | uint32_t ul_size; |
sahilmgandhi | 18:6a4db94011d3 | 145 | } pdc_packet_t; |
sahilmgandhi | 18:6a4db94011d3 | 146 | |
sahilmgandhi | 18:6a4db94011d3 | 147 | void pdc_tx_init(Pdc *p_pdc, pdc_packet_t *p_packet, |
sahilmgandhi | 18:6a4db94011d3 | 148 | pdc_packet_t *p_next_packet); |
sahilmgandhi | 18:6a4db94011d3 | 149 | void pdc_rx_init(Pdc *p_pdc, pdc_packet_t *p_packet, |
sahilmgandhi | 18:6a4db94011d3 | 150 | pdc_packet_t *p_next_packet); |
sahilmgandhi | 18:6a4db94011d3 | 151 | void pdc_rx_clear_cnt(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 152 | void pdc_enable_transfer(Pdc *p_pdc, uint32_t ul_controls); |
sahilmgandhi | 18:6a4db94011d3 | 153 | void pdc_disable_transfer(Pdc *p_pdc, uint32_t ul_controls); |
sahilmgandhi | 18:6a4db94011d3 | 154 | uint32_t pdc_read_status(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 155 | uint32_t pdc_read_rx_ptr(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 156 | uint32_t pdc_read_rx_counter(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 157 | uint32_t pdc_read_tx_ptr(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 158 | uint32_t pdc_read_tx_counter(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 159 | uint32_t pdc_read_rx_next_ptr(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 160 | uint32_t pdc_read_rx_next_counter(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 161 | uint32_t pdc_read_tx_next_ptr(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 162 | uint32_t pdc_read_tx_next_counter(Pdc *p_pdc); |
sahilmgandhi | 18:6a4db94011d3 | 163 | |
sahilmgandhi | 18:6a4db94011d3 | 164 | /// @cond |
sahilmgandhi | 18:6a4db94011d3 | 165 | /**INDENT-OFF**/ |
sahilmgandhi | 18:6a4db94011d3 | 166 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 167 | } |
sahilmgandhi | 18:6a4db94011d3 | 168 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 169 | /**INDENT-ON**/ |
sahilmgandhi | 18:6a4db94011d3 | 170 | /// @endcond |
sahilmgandhi | 18:6a4db94011d3 | 171 | |
sahilmgandhi | 18:6a4db94011d3 | 172 | /** @} */ |
sahilmgandhi | 18:6a4db94011d3 | 173 | |
sahilmgandhi | 18:6a4db94011d3 | 174 | /** |
sahilmgandhi | 18:6a4db94011d3 | 175 | * \page asfdoc_sam_drivers_pdc_extra Extra Information for Peripheral DMA Controller |
sahilmgandhi | 18:6a4db94011d3 | 176 | * |
sahilmgandhi | 18:6a4db94011d3 | 177 | * \section asfdoc_sam_drivers_pdc_extra_acronyms Acronyms |
sahilmgandhi | 18:6a4db94011d3 | 178 | * Below is a table listing the acronyms used in this module, along with their |
sahilmgandhi | 18:6a4db94011d3 | 179 | * intended meanings. |
sahilmgandhi | 18:6a4db94011d3 | 180 | * |
sahilmgandhi | 18:6a4db94011d3 | 181 | * <table> |
sahilmgandhi | 18:6a4db94011d3 | 182 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 183 | * <th>Acronym</th> |
sahilmgandhi | 18:6a4db94011d3 | 184 | * <th>Definition</th> |
sahilmgandhi | 18:6a4db94011d3 | 185 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 186 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 187 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 188 | * <td>AHB</td> |
sahilmgandhi | 18:6a4db94011d3 | 189 | * <td>Advanced High-performance Bus</td> |
sahilmgandhi | 18:6a4db94011d3 | 190 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 191 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 192 | * <td>AMBA</td> |
sahilmgandhi | 18:6a4db94011d3 | 193 | * <td> Advanced Microcontroller Bus Architecture</td> |
sahilmgandhi | 18:6a4db94011d3 | 194 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 195 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 196 | * <td>QSG</td> |
sahilmgandhi | 18:6a4db94011d3 | 197 | * <td>Quick Start Guide</td> |
sahilmgandhi | 18:6a4db94011d3 | 198 | * |
sahilmgandhi | 18:6a4db94011d3 | 199 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 200 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 201 | * <td>RCR</td> |
sahilmgandhi | 18:6a4db94011d3 | 202 | * <td>Receive Counter Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 203 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 204 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 205 | * <td>RNCR</td> |
sahilmgandhi | 18:6a4db94011d3 | 206 | * <td>Return Receive Next Counter Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 207 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 208 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 209 | * <td>RNPR</td> |
sahilmgandhi | 18:6a4db94011d3 | 210 | * <td>Receive Next Pointer Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 211 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 212 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 213 | * <td>RPR</td> |
sahilmgandhi | 18:6a4db94011d3 | 214 | * <td>Receive Pointer Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 215 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 216 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 217 | * <td>TCR</td> |
sahilmgandhi | 18:6a4db94011d3 | 218 | * <td>Transmit Counter Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 219 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 220 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 221 | * <td>TNCR</td> |
sahilmgandhi | 18:6a4db94011d3 | 222 | * <td>Transmit Next Counter Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 223 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 224 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 225 | * <td>TNPR</td> |
sahilmgandhi | 18:6a4db94011d3 | 226 | * <td>Transmit Next Pointer Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 227 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 228 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 229 | * <td>TPR</td> |
sahilmgandhi | 18:6a4db94011d3 | 230 | * <td>Transmit Pointer Register</td> |
sahilmgandhi | 18:6a4db94011d3 | 231 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 232 | * </table> |
sahilmgandhi | 18:6a4db94011d3 | 233 | * |
sahilmgandhi | 18:6a4db94011d3 | 234 | * |
sahilmgandhi | 18:6a4db94011d3 | 235 | * \section asfdoc_sam_drivers_pdc_extra_dependencies Dependencies |
sahilmgandhi | 18:6a4db94011d3 | 236 | * This driver has the following dependencies: |
sahilmgandhi | 18:6a4db94011d3 | 237 | * |
sahilmgandhi | 18:6a4db94011d3 | 238 | * - None |
sahilmgandhi | 18:6a4db94011d3 | 239 | * |
sahilmgandhi | 18:6a4db94011d3 | 240 | * |
sahilmgandhi | 18:6a4db94011d3 | 241 | * \section asfdoc_sam_drivers_pdc_extra_errata Errata |
sahilmgandhi | 18:6a4db94011d3 | 242 | * There are no errata related to this driver. |
sahilmgandhi | 18:6a4db94011d3 | 243 | * |
sahilmgandhi | 18:6a4db94011d3 | 244 | * |
sahilmgandhi | 18:6a4db94011d3 | 245 | * \section asfdoc_sam_drivers_pdc_extra_history Module History |
sahilmgandhi | 18:6a4db94011d3 | 246 | * An overview of the module history is presented in the table below, with |
sahilmgandhi | 18:6a4db94011d3 | 247 | * details on the enhancements and fixes made to the module since its first |
sahilmgandhi | 18:6a4db94011d3 | 248 | * release. The current version of this corresponds to the newest version in |
sahilmgandhi | 18:6a4db94011d3 | 249 | * the table. |
sahilmgandhi | 18:6a4db94011d3 | 250 | * |
sahilmgandhi | 18:6a4db94011d3 | 251 | * <table> |
sahilmgandhi | 18:6a4db94011d3 | 252 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 253 | * <th>Changelog</th> |
sahilmgandhi | 18:6a4db94011d3 | 254 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 255 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 256 | * <td>Initial document release</td> |
sahilmgandhi | 18:6a4db94011d3 | 257 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 258 | * </table> |
sahilmgandhi | 18:6a4db94011d3 | 259 | * |
sahilmgandhi | 18:6a4db94011d3 | 260 | * |
sahilmgandhi | 18:6a4db94011d3 | 261 | * |
sahilmgandhi | 18:6a4db94011d3 | 262 | * \page asfdoc_sam_pdc_quickstart_basic Quick Start Guide for PDC - Basic |
sahilmgandhi | 18:6a4db94011d3 | 263 | * This is the quickstart guide for \ref asfdoc_sam_drivers_pdc_group |
sahilmgandhi | 18:6a4db94011d3 | 264 | * with step-by-step instructions on how to configure and use the driver. |
sahilmgandhi | 18:6a4db94011d3 | 265 | * |
sahilmgandhi | 18:6a4db94011d3 | 266 | * |
sahilmgandhi | 18:6a4db94011d3 | 267 | * A handler is required for the interrupt, below is a simple example: |
sahilmgandhi | 18:6a4db94011d3 | 268 | * \snippet pdc_uart_example.c int_handler |
sahilmgandhi | 18:6a4db94011d3 | 269 | * |
sahilmgandhi | 18:6a4db94011d3 | 270 | * First initialise the board: |
sahilmgandhi | 18:6a4db94011d3 | 271 | * |
sahilmgandhi | 18:6a4db94011d3 | 272 | * \snippet pdc_uart_example.c board_setup |
sahilmgandhi | 18:6a4db94011d3 | 273 | * |
sahilmgandhi | 18:6a4db94011d3 | 274 | * Now setup the PDC registers: |
sahilmgandhi | 18:6a4db94011d3 | 275 | * \snippet pdc_uart_example.c pdc_config |
sahilmgandhi | 18:6a4db94011d3 | 276 | * |
sahilmgandhi | 18:6a4db94011d3 | 277 | * Enable UART IRQ: |
sahilmgandhi | 18:6a4db94011d3 | 278 | * \snippet pdc_uart_example.c uart_irq |
sahilmgandhi | 18:6a4db94011d3 | 279 | * |
sahilmgandhi | 18:6a4db94011d3 | 280 | * Enable UART interrupt |
sahilmgandhi | 18:6a4db94011d3 | 281 | * \snippet pdc_uart_example.c uart_nvic_irq |
sahilmgandhi | 18:6a4db94011d3 | 282 | * |
sahilmgandhi | 18:6a4db94011d3 | 283 | * Once the required number of bytes have been transferred, an interrupt is |
sahilmgandhi | 18:6a4db94011d3 | 284 | * triggered and the handler will run. The main program may execute other code |
sahilmgandhi | 18:6a4db94011d3 | 285 | * or be busy-waiting: |
sahilmgandhi | 18:6a4db94011d3 | 286 | * |
sahilmgandhi | 18:6a4db94011d3 | 287 | * \snippet pdc_uart_example.c busy_waiting |
sahilmgandhi | 18:6a4db94011d3 | 288 | * |
sahilmgandhi | 18:6a4db94011d3 | 289 | * \page asfdoc_sam_drivers_pdc_exqsg Examples for Peripheral DMA Controller |
sahilmgandhi | 18:6a4db94011d3 | 290 | * |
sahilmgandhi | 18:6a4db94011d3 | 291 | * This is a list of the available Quick Start guides (QSGs) and example |
sahilmgandhi | 18:6a4db94011d3 | 292 | * applications for \ref asfdoc_sam_drivers_pdc_group. QSGs are simple examples with |
sahilmgandhi | 18:6a4db94011d3 | 293 | * step-by-step instructions to configure and use this driver in a selection of |
sahilmgandhi | 18:6a4db94011d3 | 294 | * use cases. Note that a QSG can be compiled as a standalone application or be |
sahilmgandhi | 18:6a4db94011d3 | 295 | * added to the user application. |
sahilmgandhi | 18:6a4db94011d3 | 296 | * |
sahilmgandhi | 18:6a4db94011d3 | 297 | * - \subpage asfdoc_sam_pdc_quickstart_basic |
sahilmgandhi | 18:6a4db94011d3 | 298 | * - \subpage asfdoc_sam_drivers_pdc_example |
sahilmgandhi | 18:6a4db94011d3 | 299 | * |
sahilmgandhi | 18:6a4db94011d3 | 300 | * |
sahilmgandhi | 18:6a4db94011d3 | 301 | * \page asfdoc_sam_drivers_pdc_document_revision_history Document Revision History |
sahilmgandhi | 18:6a4db94011d3 | 302 | * |
sahilmgandhi | 18:6a4db94011d3 | 303 | * <table> |
sahilmgandhi | 18:6a4db94011d3 | 304 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 305 | * <th>Doc. Rev.</td> |
sahilmgandhi | 18:6a4db94011d3 | 306 | * <th>Date</td> |
sahilmgandhi | 18:6a4db94011d3 | 307 | * <th>Comments</td> |
sahilmgandhi | 18:6a4db94011d3 | 308 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 309 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 310 | * <td>42316B</td> |
sahilmgandhi | 18:6a4db94011d3 | 311 | * <td>07/2015</td> |
sahilmgandhi | 18:6a4db94011d3 | 312 | * <td>Updated title of application note and added list of supported devices</td> |
sahilmgandhi | 18:6a4db94011d3 | 313 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 314 | * <tr> |
sahilmgandhi | 18:6a4db94011d3 | 315 | * <td>42316A</td> |
sahilmgandhi | 18:6a4db94011d3 | 316 | * <td>05/2014</td> |
sahilmgandhi | 18:6a4db94011d3 | 317 | * <td>Initial document release</td> |
sahilmgandhi | 18:6a4db94011d3 | 318 | * </tr> |
sahilmgandhi | 18:6a4db94011d3 | 319 | * </table> |
sahilmgandhi | 18:6a4db94011d3 | 320 | * |
sahilmgandhi | 18:6a4db94011d3 | 321 | */ |
sahilmgandhi | 18:6a4db94011d3 | 322 | |
sahilmgandhi | 18:6a4db94011d3 | 323 | #endif /* PDC_H_INCLUDED */ |