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