SPI RAM 23LC1024 (Microchip) with DMA

Dependencies:   mbed

Fork of SPIRAM_23LC1024 by Suga koubou

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CONFIG.h Source File

CONFIG.h

00001 /*
00002     Copyright (c) 2010 Andy Kirkham
00003  
00004     Permission is hereby granted, free of charge, to any person obtaining a copy
00005     of this software and associated documentation files (the "Software"), to deal
00006     in the Software without restriction, including without limitation the rights
00007     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00008     copies of the Software, and to permit persons to whom the Software is
00009     furnished to do so, subject to the following conditions:
00010  
00011     The above copyright notice and this permission notice shall be included in
00012     all copies or substantial portions of the Software.
00013  
00014     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00017     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00019     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00020     THE SOFTWARE.
00021 */
00022 
00023 #ifdef NOCOMPILE
00024 
00025 #ifndef MODDMA_CONFIG_H
00026 #define MODDMA_CONFIG_H
00027 
00028 #include "mbed.h"
00029 
00030 namespace AjK {
00031 
00032 // Forward reference.
00033 class MODDMA;
00034 
00035 class  MODDMA_Channel_CFG_t {
00036 public:
00037 
00038     // *****************************************
00039     // From GPDMA by NXP MCU SW Application Team
00040     // *****************************************
00041     
00042     uint32_t ChannelNum;        //!< DMA channel number, should be in range from 0 to 7. 
00043     uint32_t TransferSize;      //!< Length/Size of transfer 
00044     uint32_t TransferWidth;     //!< Transfer width - used for TransferType is GPDMA_TRANSFERTYPE_m2m only 
00045     uint32_t SrcMemAddr;        //!< Physical Src Addr, used in case TransferType is chosen as MODDMA::GPDMA_TRANSFERTYPE::m2m or MODDMA::GPDMA_TRANSFERTYPE::m2p 
00046     uint32_t DstMemAddr;        //!< Physical Destination Address, used in case TransferType is chosen as MODDMA::GPDMA_TRANSFERTYPE::m2m or MODDMA::GPDMA_TRANSFERTYPE::p2m 
00047     uint32_t TransferType;      //!< Transfer Type
00048     uint32_t SrcConn;           ///!< Peripheral Source Connection type, used in case TransferType is chosen as
00049     uint32_t DstConn;           //!< Peripheral Destination Connection type, used in case TransferType is chosen as
00050     uint32_t DMALLI;            //!< Linker List Item structure data address if there's no Linker List, set as '0'
00051     
00052     // Mbed specifics.
00053     
00054     MODDMA_Channel_CFG_t() {
00055         isrIntTCStat  = new FunctionPointer;
00056         isrIntErrStat = new FunctionPointer;
00057     }
00058     
00059     ~MODDMA_Channel_CFG_t() {
00060         delete(isrIntTCStat);
00061         delete(isrIntErrStat);
00062     }
00063         
00064     class MODDMA_Channel_CFG_t * channelNum(uint32_t n)    { ChannelNum = n;    return this; }
00065     class MODDMA_Channel_CFG_t * transferSize(uint32_t n)  { TransferSize = n;  return this; }
00066     class MODDMA_Channel_CFG_t * transferWidth(uint32_t n) { TransferWidth = n; return this; }
00067     class MODDMA_Channel_CFG_t * srcMemAddr(uint32_t n)    { SrcMemAddr = n;    return this; }
00068     class MODDMA_Channel_CFG_t * dstMemAddr(uint32_t n)    { DstMemAddr = n;    return this; }
00069     class MODDMA_Channel_CFG_t * transferType(uint32_t n)  { TransferType = n;  return this; }
00070     class MODDMA_Channel_CFG_t * srcConn(uint32_t n)       { SrcConn = n;       return this; }
00071     class MODDMA_Channel_CFG_t * dstConn(uint32_t n)       { DstConn = n;       return this; }
00072     class MODDMA_Channel_CFG_t * dmaLLI(uint32_t n)        { DMALLI = n;        return this; }
00073     
00074     uint32_t channelNum(void) { return ChannelNum; }
00075     
00076     FunctionPointer *isrIntTCStat;                        
00077     FunctionPointer *isrIntErrStat;                        
00078 };
00079 
00080 /**
00081  * @brief GPDMA Linker List Item structure type definition
00082  */
00083 class GPDMA_LLI_t 
00084 {
00085 public:
00086     uint32_t SrcAddr;    //!< Source Address 
00087     uint32_t DstAddr;    //!< Destination address 
00088     uint32_t NextLLI;    //!< Next LLI address, otherwise set to '0' 
00089     uint32_t Control;    //!< GPDMA Control of this LLI 
00090 };
00091 
00092 }; // namespace AjK ends.
00093 
00094 #endif 
00095 #endif