From f69fefefa96339253d46b9f17833f0d0f1c39014 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 5 Jun 2013 11:23:41 +0700 Subject: added dcd_dma_descriptor_t typdef reorganize test project, multiple test projects each is specifically for an MCU --- tinyusb/device/dcd_lpc175x_6x.c | 1 + tinyusb/device/dcd_lpc175x_6x.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'tinyusb') diff --git a/tinyusb/device/dcd_lpc175x_6x.c b/tinyusb/device/dcd_lpc175x_6x.c index 47b7a7043..88ecb1529 100644 --- a/tinyusb/device/dcd_lpc175x_6x.c +++ b/tinyusb/device/dcd_lpc175x_6x.c @@ -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 diff --git a/tinyusb/device/dcd_lpc175x_6x.h b/tinyusb/device/dcd_lpc175x_6x.h index e57bfcab1..9786746a5 100644 --- a/tinyusb/device/dcd_lpc175x_6x.h +++ b/tinyusb/device/dcd_lpc175x_6x.h @@ -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 -- cgit v1.3.1