[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/tos/interfaces DMA.h, 1.2, 1.3

steve ayer ayer1 at users.sourceforge.net
Thu Mar 27 13:32:43 PDT 2008


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17388

Modified Files:
	DMA.h 
Log Message:

many detailed additions for support of enhanced DMA_M module.


Index: DMA.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/interfaces/DMA.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DMA.h	3 Aug 2006 19:16:49 -0000	1.2
--- DMA.h	27 Mar 2008 20:32:39 -0000	1.3
***************
*** 31,45 ****
   * Authors:  Steve Ayer
   *           April 2005
   *
   */
  
! enum addressIncrement{
      ADDR_FIXED,
      ADDR_DECREMENT = 2,
      ADDR_INCREMENT
  };
  
! #define DMA_CHANNELS 3
  
- #define  CHANNELS_USED  uniqueCount("DMA")
  
--- 31,168 ----
   * Authors:  Steve Ayer
   *           April 2005
+ ***********************************************************************
+ Revised by Stephen Linder spl at alum.mit.edu
+ 			October 2007
+ Added enumerations and structures to augment the DMA.NC interface.
+ 
   *
   */
  
! #define DMA_CHANNELS 3
! #define  CHANNELS_USED  uniqueCount("DMA")
! 
! typedef enum  {
      ADDR_FIXED,
      ADDR_DECREMENT = 2,
      ADDR_INCREMENT
+ } addressIncrement;
+ 
+ ////////////////////////////////////////////////////////////////////////////////////
+ // Added by SPL 10/16/07
+ // This was taken from MSP430DMA.h written by Ben Greenstein <ben at cs.ucla.edu>
+ // can not include the whole file because they both use DMA_CHANNELS
+ 
+ enum {
+   DMA_CHANNEL0 = 0,
+   DMA_CHANNEL1 = 1,
+   DMA_CHANNEL2 = 2,
+   DMA_CHANNEL_UNKNOWN = 3
  };
  
! enum {
!   DMA_CHANNEL_AVAILABLE = 0,
!   DMA_CHANNEL_IN_USE = 1
! };
! 
! // HPL constants
! 
! enum {
!   DMA0TSEL_SHIFT = (0),
!   DMA1TSEL_SHIFT = (4),
!   DMA2TSEL_SHIFT = (8),
!   DMATSEL_MASK   = (0xF)
! };
! enum {
!   DMASRCINCR_SHIFT = (8),
!   DMADSTINCR_SHIFT = (10),
!   DMAINCR_MASK = (0x3)
! };
! enum {
!   DMADT_SHIFT = (12),
!   DMADT_MASK = (0x3)
! };
! typedef enum {
!     DMA_TRIGGER_DMAREQ =          0x0, // software trigger
!     DMA_TRIGGER_TACCR2 =          0x1,
!     DMA_TRIGGER_TBCCR2 =          0x2,
!     DMA_TRIGGER_USARTRX =         0x3, // URXIFG0 (UART/SPI), data received (I2C)
!     DMA_TRIGGER_USARTTX =         0x4, // UTXIFG0 (UART/SPI), transmit ready (I2C)
!     DMA_TRIGGER_DAC12IFG =        0x5, // DAC12_0CTL DAC12IFG bit
!     DMA_TRIGGER_ADC12IFGx =       0x6,
!     DMA_TRIGGER_TACCR0 =          0x7, // CCIFG bit
!     DMA_TRIGGER_TBCCR0 =          0x8, // CCIFG bit
!     DMA_TRIGGER_URXIFG1 =         0x9,
!     DMA_TRIGGER_UTXIFG1 =         0xa,
!     DMA_TRIGGER_MULT =            0xb, // Hardware Multiplier Ready
!     DMA_TRIGGER_DMAxIFG =         0xe, // DMA0IFG triggers DMA channel 1
!                                        // DMA1IFG triggers DMA channel 2
!                                        // DMA2IFG triggers DMA channel 0
!     DMA_TRIGGER_DMAE0 =           0xf  // External Trigger DMAE0
! } dma_trigger_t;
! 
! 
! enum {
!   DISABLE_NMI = 0,
!   ENABLE_NMI = 1
! };
! enum {
!   NOT_ROUND_ROBIN = 0,
!   ROUND_ROBIN = 1,
! };
! enum {
!   NOT_ON_FETCH = 0,
!   ON_FETCH = 1
! };
! typedef enum {
!   DMA_EDGE_SENSITIVE = 0x0,
!   DMA_LEVEL_SENSITIVE = 0x1
! } dma_level_t;
! typedef enum {
!   DMA_WORD = 0x0,
!   DMA_BYTE = 0x1
! } dma_byte_t;
! typedef enum {
!   DMA_ADDRESS_UNCHANGED = 0x0,
!   DMA_ADDRESS_DECREMENTED = 0x2,
!   DMA_ADDRESS_INCREMENTED = 0x3
! } dma_incr_t;
! typedef enum {
!   DMA_SINGLE_TRANSFER = 0x0,
!   DMA_BLOCK_TRANSFER = 0x1,
!   DMA_BURST_BLOCK_TRANSFER = 0x2,
!   DMA_REPEATED_SINGLE_TRANSFER = 0x4,
!   DMA_REPEATED_BLOCK_TRANSFER = 0x5,
!   DMA_REPEATED_BURST_BLOCK_TRANSFER = 0x7
! } dma_transfer_mode_t;
! 
! typedef struct  {					//dma_state_s
!   unsigned int enableNMI : 1;
!   unsigned int roundRobin : 1;
!   unsigned int onFetch : 1;
!   unsigned int reserved : 13;
! } __attribute__ ((packed)) dma_state_t;
! 
! typedef struct {
!   unsigned int trigger : 4;
!   unsigned int reserved : 12;
! 
!   unsigned int request : 1;
!   unsigned int abort : 1;
!   unsigned int interruptEnable : 1;
!   unsigned int interruptFlag : 1;
!   unsigned int enable : 1;
!   unsigned int level : 1;            /* or edge- triggered */
!   unsigned int srcByte : 1;          /* or word */
!   unsigned int dstByte : 1;
!   unsigned int srcIncrement : 2;     /* or no-increment, decrement */
!   unsigned int dstIncrement : 2;
!   unsigned int transferMode : 3;
!   unsigned int reserved2 : 1;
! 
!   uint16_t  srcAddr;
!   uint16_t  dstAddr;
!   uint16_t  size;
! } __attribute__ ((packed)) dma_channel_state_t;
! 
  
  



More information about the Tinyos-contrib-commits mailing list