Dependencies:   mbed NetServicesMin

Committer:
fernya
Date:
Mon Jun 18 03:59:39 2012 +0000
Revision:
0:aa9ebbd3715f
Beta

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fernya 0:aa9ebbd3715f 1 /*
fernya 0:aa9ebbd3715f 2 Copyright (c) 2010 Andy Kirkham
fernya 0:aa9ebbd3715f 3
fernya 0:aa9ebbd3715f 4 Permission is hereby granted, free of charge, to any person obtaining a copy
fernya 0:aa9ebbd3715f 5 of this software and associated documentation files (the "Software"), to deal
fernya 0:aa9ebbd3715f 6 in the Software without restriction, including without limitation the rights
fernya 0:aa9ebbd3715f 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
fernya 0:aa9ebbd3715f 8 copies of the Software, and to permit persons to whom the Software is
fernya 0:aa9ebbd3715f 9 furnished to do so, subject to the following conditions:
fernya 0:aa9ebbd3715f 10
fernya 0:aa9ebbd3715f 11 The above copyright notice and this permission notice shall be included in
fernya 0:aa9ebbd3715f 12 all copies or substantial portions of the Software.
fernya 0:aa9ebbd3715f 13
fernya 0:aa9ebbd3715f 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
fernya 0:aa9ebbd3715f 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
fernya 0:aa9ebbd3715f 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
fernya 0:aa9ebbd3715f 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
fernya 0:aa9ebbd3715f 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
fernya 0:aa9ebbd3715f 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
fernya 0:aa9ebbd3715f 20 THE SOFTWARE.
fernya 0:aa9ebbd3715f 21 */
fernya 0:aa9ebbd3715f 22
fernya 0:aa9ebbd3715f 23 #ifdef NOCOMPILE
fernya 0:aa9ebbd3715f 24
fernya 0:aa9ebbd3715f 25 #ifndef MODDMA_CONFIG_H
fernya 0:aa9ebbd3715f 26 #define MODDMA_CONFIG_H
fernya 0:aa9ebbd3715f 27
fernya 0:aa9ebbd3715f 28 #include "mbed.h"
fernya 0:aa9ebbd3715f 29
fernya 0:aa9ebbd3715f 30 namespace AjK {
fernya 0:aa9ebbd3715f 31
fernya 0:aa9ebbd3715f 32 // Forward reference.
fernya 0:aa9ebbd3715f 33 class MODDMA;
fernya 0:aa9ebbd3715f 34
fernya 0:aa9ebbd3715f 35 class MODDMA_Channel_CFG_t {
fernya 0:aa9ebbd3715f 36 public:
fernya 0:aa9ebbd3715f 37
fernya 0:aa9ebbd3715f 38 // *****************************************
fernya 0:aa9ebbd3715f 39 // From GPDMA by NXP MCU SW Application Team
fernya 0:aa9ebbd3715f 40 // *****************************************
fernya 0:aa9ebbd3715f 41
fernya 0:aa9ebbd3715f 42 uint32_t ChannelNum; //!< DMA channel number, should be in range from 0 to 7.
fernya 0:aa9ebbd3715f 43 uint32_t TransferSize; //!< Length/Size of transfer
fernya 0:aa9ebbd3715f 44 uint32_t TransferWidth; //!< Transfer width - used for TransferType is GPDMA_TRANSFERTYPE_m2m only
fernya 0:aa9ebbd3715f 45 uint32_t SrcMemAddr; //!< Physical Src Addr, used in case TransferType is chosen as MODDMA::GPDMA_TRANSFERTYPE::m2m or MODDMA::GPDMA_TRANSFERTYPE::m2p
fernya 0:aa9ebbd3715f 46 uint32_t DstMemAddr; //!< Physical Destination Address, used in case TransferType is chosen as MODDMA::GPDMA_TRANSFERTYPE::m2m or MODDMA::GPDMA_TRANSFERTYPE::p2m
fernya 0:aa9ebbd3715f 47 uint32_t TransferType; //!< Transfer Type
fernya 0:aa9ebbd3715f 48 uint32_t SrcConn; ///!< Peripheral Source Connection type, used in case TransferType is chosen as
fernya 0:aa9ebbd3715f 49 uint32_t DstConn; //!< Peripheral Destination Connection type, used in case TransferType is chosen as
fernya 0:aa9ebbd3715f 50 uint32_t DMALLI; //!< Linker List Item structure data address if there's no Linker List, set as '0'
fernya 0:aa9ebbd3715f 51
fernya 0:aa9ebbd3715f 52 // Mbed specifics.
fernya 0:aa9ebbd3715f 53
fernya 0:aa9ebbd3715f 54 MODDMA_Channel_CFG_t() {
fernya 0:aa9ebbd3715f 55 isrIntTCStat = new FunctionPointer;
fernya 0:aa9ebbd3715f 56 isrIntErrStat = new FunctionPointer;
fernya 0:aa9ebbd3715f 57 }
fernya 0:aa9ebbd3715f 58
fernya 0:aa9ebbd3715f 59 ~MODDMA_Channel_CFG_t() {
fernya 0:aa9ebbd3715f 60 delete(isrIntTCStat);
fernya 0:aa9ebbd3715f 61 delete(isrIntErrStat);
fernya 0:aa9ebbd3715f 62 }
fernya 0:aa9ebbd3715f 63
fernya 0:aa9ebbd3715f 64 class MODDMA_Channel_CFG_t * channelNum(uint32_t n) { ChannelNum = n; return this; }
fernya 0:aa9ebbd3715f 65 class MODDMA_Channel_CFG_t * transferSize(uint32_t n) { TransferSize = n; return this; }
fernya 0:aa9ebbd3715f 66 class MODDMA_Channel_CFG_t * transferWidth(uint32_t n) { TransferWidth = n; return this; }
fernya 0:aa9ebbd3715f 67 class MODDMA_Channel_CFG_t * srcMemAddr(uint32_t n) { SrcMemAddr = n; return this; }
fernya 0:aa9ebbd3715f 68 class MODDMA_Channel_CFG_t * dstMemAddr(uint32_t n) { DstMemAddr = n; return this; }
fernya 0:aa9ebbd3715f 69 class MODDMA_Channel_CFG_t * transferType(uint32_t n) { TransferType = n; return this; }
fernya 0:aa9ebbd3715f 70 class MODDMA_Channel_CFG_t * srcConn(uint32_t n) { SrcConn = n; return this; }
fernya 0:aa9ebbd3715f 71 class MODDMA_Channel_CFG_t * dstConn(uint32_t n) { DstConn = n; return this; }
fernya 0:aa9ebbd3715f 72 class MODDMA_Channel_CFG_t * dmaLLI(uint32_t n) { DMALLI = n; return this; }
fernya 0:aa9ebbd3715f 73
fernya 0:aa9ebbd3715f 74 uint32_t channelNum(void) { return ChannelNum; }
fernya 0:aa9ebbd3715f 75
fernya 0:aa9ebbd3715f 76 FunctionPointer *isrIntTCStat;
fernya 0:aa9ebbd3715f 77 FunctionPointer *isrIntErrStat;
fernya 0:aa9ebbd3715f 78 };
fernya 0:aa9ebbd3715f 79
fernya 0:aa9ebbd3715f 80 /**
fernya 0:aa9ebbd3715f 81 * @brief GPDMA Linker List Item structure type definition
fernya 0:aa9ebbd3715f 82 */
fernya 0:aa9ebbd3715f 83 class GPDMA_LLI_t
fernya 0:aa9ebbd3715f 84 {
fernya 0:aa9ebbd3715f 85 public:
fernya 0:aa9ebbd3715f 86 uint32_t SrcAddr; //!< Source Address
fernya 0:aa9ebbd3715f 87 uint32_t DstAddr; //!< Destination address
fernya 0:aa9ebbd3715f 88 uint32_t NextLLI; //!< Next LLI address, otherwise set to '0'
fernya 0:aa9ebbd3715f 89 uint32_t Control; //!< GPDMA Control of this LLI
fernya 0:aa9ebbd3715f 90 };
fernya 0:aa9ebbd3715f 91
fernya 0:aa9ebbd3715f 92 }; // namespace AjK ends.
fernya 0:aa9ebbd3715f 93
fernya 0:aa9ebbd3715f 94 #endif
fernya 0:aa9ebbd3715f 95 #endif