added dcd_dma_descriptor_t typdef

reorganize test project, multiple test projects each is specifically for an MCU
This commit is contained in:
hathach
2013-06-05 11:23:41 +07:00
parent 6fb34f0e7a
commit f69fefefa9
45 changed files with 190 additions and 89 deletions

View File

@@ -51,6 +51,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
STATIC_ dcd_dma_descriptor_t* dcd_udca[32] ATTR_ALIGNED(128) TUSB_CFG_ATTR_USBRAM;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION

View File

@@ -46,11 +46,49 @@
#ifndef _TUSB_DCD_LPC175X_6X_H_
#define _TUSB_DCD_LPC175X_6X_H_
#include "common/common.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
//------------- Word 0 -------------//
uint32_t next;
//------------- Word 1 -------------//
uint16_t mode : 2; // either normal or ATLE(auto length extraction)
uint16_t is_next_valid : 1;
uint16_t : 1;
uint16_t is_isochronous : 1; // is an iso endpoint
uint16_t max_packet_size : 11;
volatile uint16_t buffer_length;
//------------- Word 2 -------------//
volatile uint8_t* buffer_start_addr;
//------------- Word 3 -------------//
volatile uint16_t is_retired : 1; // initialized to zero
volatile uint16_t status : 4;
volatile uint16_t iso_last_packet_valid : 1;
volatile uint16_t atle_is_lsb_extracted : 1; // used in ATLE mode
volatile uint16_t atle_is_msb_extracted : 1; // used in ATLE mode
volatile uint16_t atle_message_length_position : 6; // used in ATLE mode
uint16_t : 2;
volatile uint16_t present_count; // The number of bytes transferred by the DMA engine. The DMA engine updates this field after completing each packet transfer.
//------------- Word 4 -------------//
// uint32_t iso_packet_size_addr; // iso only, can be omitted for non-iso
} ATTR_ALIGNED(4) dcd_dma_descriptor_t;
#define DCD_DD_NUM 10 // TODO scale with configure
typedef struct {
dcd_dma_descriptor_t dd[DCD_DD_NUM];
}dcd_data_t;
#ifdef __cplusplus
}
#endif