MBED_LPC1768_Test Pulse msec/usec Interval Output P29/P30 & Input P21 Status Send USB Serial Log

Dependencies:   mbed

Committer:
H_Tsunemoto
Date:
Tue May 29 02:41:54 2018 +0000
Revision:
0:47c1b6a0c166
Pulse On/OFF OutPut P29/P30 & Rep Input P21 Status Output USBSerial;

Who changed what in which revision?

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