http://http://diytec.web.fc2.com/mark2r2/

Dependencies:   EthernetNetIf NTPClient_NetServices mbed ConfigFile

Committer:
mark2r2
Date:
Tue Sep 20 12:46:26 2011 +0000
Revision:
0:08a4d61cd84c
V1.0

Who changed what in which revision?

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