ok
Dependents: Bootcamp-dma-serial
Fork of MODDMA by
Diff: MODDMA.h
- Revision:
- 3:f61c089ca882
- Parent:
- 2:203d22a890cd
- Child:
- 4:67f327b9278e
--- a/MODDMA.h Tue Nov 23 14:54:15 2010 +0000 +++ b/MODDMA.h Tue Nov 23 15:08:21 2010 +0000 @@ -29,7 +29,7 @@ #ifndef MODDMA_H #define MODDMA_H -/** @defgroup API The MODSERIAL API */ +/** @defgroup API The MODDMA API */ /** @defgroup MISC Misc MODSERIAL functions */ /** @defgroup INTERNALS MODSERIAL Internals */ @@ -46,7 +46,6 @@ * * <b>MODDMA_Config</b> defines a configuration that can be passed to the MODDMA controller * instance to perform a GPDMA data transfer. - * transfers from memory to memory, memory to peripheral or peripheral to memory. */ class MODDMA_Config { protected: @@ -132,10 +131,10 @@ * <b>MODDMA</b> defines a GPDMA controller and multiple DMA configurations that allow for DMA * transfers from memory to memory, memory to peripheral or peripheral to memory. * - * At the heart of the library is the MODDMA class the defines a single instance controller that + * At the heart of the library is the MODDMA class that defines a single instance controller that * manages all the GPDMA hardware registers and interrupts. The controller can accept multiple - * configurations that define the transfer. Each configuration specifies the src and dest information - * and other associated parts to maintain the transfer process. + * configurations that define the channel transfers. Each configuration specifies the source and + * destination information and other associated parts to maintain the transfer process. * * Standard example: * @code @@ -159,7 +158,7 @@ * ->channelNum ( MODDMA::Channel_0 ) // The DMA channel to use. * ->srcMemAddr ( (uint32_t) &s ) // A pointer to the buffer to send. * ->transferSize ( sizeof(s) ) // The size of that buffer. - * ->transferType ( MODDMA::m2p ) // Buffer is memory, dest is peripheral + * ->transferType ( MODDMA::m2p ) // Source is memory, destination is peripheral * ->dstConn ( MODDMA::UART0_Tx ) // Specifically, peripheral is Uart0 TX (USBTX, USBRX) * ; // config end. * @@ -295,6 +294,7 @@ /** * Used to setup the DMA controller to prepare for a data transfer. * + * @ingroup API * @param c A pointer to an instance of MODDMA_Config to setup. */ Status Setup(MODDMA_Config *c); @@ -302,6 +302,7 @@ /** * Enable and begin data transfer. * + * @ingroup API * @param ChannelNumber Type CHANNELS, the channel number to enable */ void Enable(CHANNELS ChannelNumber); @@ -309,6 +310,7 @@ /** * Enable and begin data transfer (overloaded function) * + * @ingroup API * @param ChannelNumber Type uin32_t, the channel number to enable */ void Enable(uint32_t ChannelNumber) { Enable((CHANNELS)(ChannelNumber & 0x7)); } @@ -316,6 +318,7 @@ /** * Disable a channel and end data transfer. * + * @ingroup API * @param ChannelNumber Type CHANNELS, the channel number to enable */ void Disable(CHANNELS ChannelNumber); @@ -323,6 +326,7 @@ /** * Disable a channel and end data transfer (overloaded function) * + * @ingroup API * @param ChannelNumber Type uin32_t, the channel number to disable */ void Disable(uint32_t ChannelNumber) { Disable((CHANNELS)(ChannelNumber & 0x7)); } @@ -330,6 +334,7 @@ /** * Is the specified channel enabled? * + * @ingroup API * @param ChannelNumber Type CHANNELS, the channel number to test * @return bool true if enabled, false otherwise. */ @@ -338,6 +343,7 @@ /** * Is the specified channel enabled? (overloaded function) * + * @ingroup API * @param ChannelNumber Type uin32_t, the channel number to test * @return bool true if enabled, false otherwise. */ @@ -388,6 +394,7 @@ /** * Get a pointer to the current configuration the ISR is servicing. * + * @ingroup API * @return MODDMA_Config * A pointer to the setup the ISR is currently servicing. */ MODDMA_Config *getConfig(void) { return setups[IrqProcessingChannel]; } @@ -404,6 +411,7 @@ /** * Gets which channel the ISR is currently servicing. * + * @ingroup API * @return CHANNELS The current channel the ISR is servicing. */ CHANNELS irqProcessingChannel(void) { return IrqProcessingChannel; } @@ -445,18 +453,21 @@ /** * Clear the error interrupt after handling. * + * @ingroup API * @param CHANNELS The channel the IQR occured on. */ void clearErrIrq(CHANNELS n) { LPC_GPDMA->DMACIntTCClear = (uint32_t)(1UL << n); } /** * Clear the error interrupt the ISR is currently handing. + * @ingroup API */ void clearErrIrq(void) { clearErrIrq( IrqProcessingChannel ); } /** * Is the supplied channel currently active? * + * @ingroup API * @param CHANNELS The channel to inquire about. * @return bool true if active, false otherwise. */ @@ -465,6 +476,7 @@ /** * Halt the supplied channel. * + * @ingroup API * @param CHANNELS The channel to halt. */ void haltChannel(CHANNELS ChannelNumber); @@ -472,6 +484,7 @@ /** * Wait for channel transfer to complete and then halt. * + * @ingroup API * @param CHANNELS The channel to wait for then halt. */ void haltAndWaitChannelComplete(CHANNELS n) { haltChannel(n); while (isActive(n)); }