#ifndef __GPDMA_H__
#define	__GPDMA_H__

#define	CODEC_SSIZE	850	/* Number of samples in one codec buffer */
#define	USB_SSIZE	96	/* Number of samples in one USB buffer */
#define	USB_DMA_BUFSIZE	(USB_SSIZE*2*32)	/* 32ms worth byte size */
#define	DMA_NBUF	4
#define	CODEC_DMA_BUFSIZE	(CODEC_SSIZE*2*DMA_NBUF)
#define	BCODEC_SSIZE	((USB_DMA_BUFSIZE+CODEC_DMA_BUFSIZE)/2/DMA_NBUF)

#ifndef _MACRO_ONLY
/*
 * LPC23xx LLI (Linked List Item) structure
 */
typedef struct s_LLI {
    UB *DMACCxSrcAddr;		/* Source address */
    UB *DMACCxDestAddr;		/* Destination address */
    struct s_LLI *pDMACCxLLI;	/* Pointer to next LLI */
    UW DMACCxControl;		/* Control word */
} t_LLI;

typedef struct s_codec_buff {
  UH buff_index;  /* shows which buffer is beeing filled */
  UH put_index;	  /* next put positon in current buffer */
  UH *buffer[DMA_NBUF];
  t_LLI codec_LLI[DMA_NBUF];
} t_codec_buffer;

#endif

#endif	/* __GPDMA_H__ */
