aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile30
-rw-r--r--libmaple/usb/descriptors.h124
-rw-r--r--libmaple/usb/usb.c2
-rw-r--r--libmaple/usb/usb_lib/usb_type.h3
4 files changed, 77 insertions, 82 deletions
diff --git a/Makefile b/Makefile
index d263bdd..0643359 100644
--- a/Makefile
+++ b/Makefile
@@ -29,16 +29,16 @@ LIB_PATH = libmaple
OUTDIRS = $(BUILD_PATH)/$(LIB_PATH)\
$(BUILD_PATH)/wirish \
$(BUILD_PATH)/wirish/comm \
- $(BUILD_PATH)/wirish/usb \
- $(BUILD_PATH)/wirish/usb_lib
+ $(BUILD_PATH)/$(LIB_PATH)/usb \
+ $(BUILD_PATH)/$(LIB_PATH)/usb/usb_lib
INCLUDES = -I$(LIB_PATH) \
-I./ \
-Iwirish \
-Iwirish/comm \
- -Iwirish/usb \
- -Iwirish/usb_lib
+ -I$(LIB_PATH)/usb \
+ -I$(LIB_PATH)/usb/usb_lib
# default is to upload to flash
#DEFFLAGS = VECT_TAB_BASE
@@ -71,7 +71,6 @@ CSRC = libmaple/systick.c \
libmaple/nvic.c \
libmaple/usart.c \
libmaple/util.c \
- libmaple/usb.c \
libmaple/rcc.c \
libmaple/flash.c \
libmaple/spi.c \
@@ -81,21 +80,20 @@ CSRC = libmaple/systick.c \
wirish/time.c \
wirish/pwm.c \
wirish/ext_interrupts.c \
- wirish/wirish_digital.c
- wirish/usb/usb.c \
- wirish/usb/usb_callbacks.c \
- wirish/usb/usb_hardware.c \
- wirish/usb/descriptors.c \
- wirish/usb/usb_lib/usb_core.c \
- wirish/usb/usb_lib/usb_init.c \
- wirish/usb/usb_lib/usb_int.c \
- wirish/usb/usb_lib/usb_mem.c \
- wirish/usb/usb_lib/usb_regs.c \
+ wirish/wirish_digital.c \
+ libmaple/usb/usb.c \
+ libmaple/usb/usb_callbacks.c \
+ libmaple/usb/usb_hardware.c \
+ libmaple/usb/descriptors.c \
+ libmaple/usb/usb_lib/usb_core.c \
+ libmaple/usb/usb_lib/usb_init.c \
+ libmaple/usb/usb_lib/usb_int.c \
+ libmaple/usb/usb_lib/usb_mem.c \
+ libmaple/usb/usb_lib/usb_regs.c \
CPPSRC = wirish/wirish_math.cpp \
wirish/Print.cpp \
wirish/comm/HardwareSerial.cpp \
- wirish/comm/HardwareUsb.cpp \
wirish/comm/HardwareSPI.cpp \
wirish/cxxabi-compat.cpp \
diff --git a/libmaple/usb/descriptors.h b/libmaple/usb/descriptors.h
index 6e96024..1efe8c1 100644
--- a/libmaple/usb/descriptors.h
+++ b/libmaple/usb/descriptors.h
@@ -65,47 +65,47 @@ typedef struct {
} USB_Descriptor_Device;
typedef struct {
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint16_t wTotalLength;
- uint8_t bNumInterfaces;
- uint8_t bConfigurationValue;
- uint8_t iConfiguration;
- uint8_t bmAttributes;
- uint8_t bMaxPower;
+ uint8 bLength;
+ uint8 bDescriptorType;
+ uint16 wTotalLength;
+ uint8 bNumInterfaces;
+ uint8 bConfigurationValue;
+ uint8 iConfiguration;
+ uint8 bmAttributes;
+ uint8 bMaxPower;
} USB_Descriptor_Config_Header;
typedef struct {
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint8_t bInterfaceNumber;
- uint8_t bAlternateSetting;
- uint8_t bNumEndpoints;
- uint8_t bInterfaceClass;
- uint8_t bInterfaceSubClass;
- uint8_t bInterfaceProtocol;
- uint8_t iInterface;
+ uint8 bLength;
+ uint8 bDescriptorType;
+ uint8 bInterfaceNumber;
+ uint8 bAlternateSetting;
+ uint8 bNumEndpoints;
+ uint8 bInterfaceClass;
+ uint8 bInterfaceSubClass;
+ uint8 bInterfaceProtocol;
+ uint8 iInterface;
} USB_Descriptor_Interface;
typedef struct {
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint8_t bEndpointAddress;
- uint8_t bmAttributes;
- uint16_t wMaxPacketSize;
- uint8_t bInterval;
+ uint8 bLength;
+ uint8 bDescriptorType;
+ uint8 bEndpointAddress;
+ uint8 bmAttributes;
+ uint16 wMaxPacketSize;
+ uint8 bInterval;
} USB_Descriptor_Endpoint;
typedef struct {
/* config header */
- uint8_t bLength;
- uint8_t bDescriptorType;
- uint16_t wTotalLength;
- uint8_t bNumInterfaces;
- uint8_t bConfigurationValue;
- uint8_t iConfiguration;
- uint8_t bmAttributes;
- uint8_t bMaxPower;
+ uint8 bLength;
+ uint8 bDescriptorType;
+ uint16 wTotalLength;
+ uint8 bNumInterfaces;
+ uint8 bConfigurationValue;
+ uint8 iConfiguration;
+ uint8 bmAttributes;
+ uint8 bMaxPower;
USB_Descriptor_Interface CCI_Interface;
struct {
@@ -136,48 +136,48 @@ typedef struct {
/*
USB_Descriptor_Endpoint ManagementEndpoint;
*/
- uint8_t EP1_bLength;
- uint8_t EP1_bDescriptorType;
- uint8_t EP1_bEndpointAddress;
- uint8_t EP1_bmAttributes;
- uint8_t EP1_wMaxPacketSize0;
- uint8_t EP1_wMaxPacketSize1;
- uint8_t EP1_bInterval;
+ uint8 EP1_bLength;
+ uint8 EP1_bDescriptorType;
+ uint8 EP1_bEndpointAddress;
+ uint8 EP1_bmAttributes;
+ uint8 EP1_wMaxPacketSize0;
+ uint8 EP1_wMaxPacketSize1;
+ uint8 EP1_bInterval;
/*
USB_Descriptor_Interface DCI_Interface;
*/
- uint8_t DCI_bLength;
- uint8_t DCI_bDescriptorType;
- uint8_t DCI_bInterfaceNumber;
- uint8_t DCI_bAlternateSetting;
- uint8_t DCI_bNumEndpoints;
- uint8_t DCI_bInterfaceClass;
- uint8_t DCI_bInterfaceSubClass;
- uint8_t DCI_bInterfaceProtocol;
- uint8_t DCI_iInterface;
+ uint8 DCI_bLength;
+ uint8 DCI_bDescriptorType;
+ uint8 DCI_bInterfaceNumber;
+ uint8 DCI_bAlternateSetting;
+ uint8 DCI_bNumEndpoints;
+ uint8 DCI_bInterfaceClass;
+ uint8 DCI_bInterfaceSubClass;
+ uint8 DCI_bInterfaceProtocol;
+ uint8 DCI_iInterface;
/*
USB_Descriptor_Endpoint DataOutEndpoint;
USB_Descriptor_Endpoint DataInEndpoint;
*/
- uint8_t EP2_bLength;
- uint8_t EP2_bDescriptorType;
- uint8_t EP2_bEndpointAddress;
- uint8_t EP2_bmAttributes;
- uint8_t EP2_wMaxPacketSize0;
- uint8_t EP2_wMaxPacketSize1;
- uint8_t EP2_bInterval;
-
- uint8_t EP3_bLength;
- uint8_t EP3_bDescriptorType;
- uint8_t EP3_bEndpointAddress;
- uint8_t EP3_bmAttributes;
- uint8_t EP3_wMaxPacketSize0;
- uint8_t EP3_wMaxPacketSize1;
- uint8_t EP3_bInterval;
+ uint8 EP2_bLength;
+ uint8 EP2_bDescriptorType;
+ uint8 EP2_bEndpointAddress;
+ uint8 EP2_bmAttributes;
+ uint8 EP2_wMaxPacketSize0;
+ uint8 EP2_wMaxPacketSize1;
+ uint8 EP2_bInterval;
+
+ uint8 EP3_bLength;
+ uint8 EP3_bDescriptorType;
+ uint8 EP3_bEndpointAddress;
+ uint8 EP3_bmAttributes;
+ uint8 EP3_wMaxPacketSize0;
+ uint8 EP3_wMaxPacketSize1;
+ uint8 EP3_bInterval;
}USB_Descriptor_Config;
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c
index bbea77d..f926e81 100644
--- a/libmaple/usb/usb.c
+++ b/libmaple/usb/usb.c
@@ -43,7 +43,7 @@
/* persistent usb structs */
volatile uint32 bDeviceState = UNCONNECTED;
-volatile uint16_t wIstr = 0;
+volatile uint16 wIstr = 0;
volatile bIntPackSOF = 0;
DEVICE Device_Table =
diff --git a/libmaple/usb/usb_lib/usb_type.h b/libmaple/usb/usb_lib/usb_type.h
index 44b1f8c..1106786 100644
--- a/libmaple/usb/usb_lib/usb_type.h
+++ b/libmaple/usb/usb_lib/usb_type.h
@@ -27,8 +27,6 @@ extern "C" {
#define NULL ((void *)0)
#endif
-#ifndef __STM32F10x_TYPE_H
-
typedef signed long s32;
typedef signed short s16;
typedef signed char s8;
@@ -65,7 +63,6 @@ typedef enum { RESET = 0, SET = !RESET } FlagStatus, ITStatus;
typedef enum { DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
typedef enum { ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
-#endif
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */