aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb/descriptors.c
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-02-27 11:42:56 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-02-27 11:42:56 -0500
commit4e90248a2e81ec7bd8d3cfa858cef4a045cc1003 (patch)
treefa10544230e6e3e29dcdfc94fd5fc880dce009ba /libmaple/usb/descriptors.c
parenta949fe81d069fb3ee727537ba3d5f9f926129d62 (diff)
downloadlibrambutan-4e90248a2e81ec7bd8d3cfa858cef4a045cc1003.tar.gz
librambutan-4e90248a2e81ec7bd8d3cfa858cef4a045cc1003.zip
Cleaned out libmaple.h; this had wide-ranging implications.
Many of the #defines in libmaple.h were board-specific, not MCU-specific. Most of these were only used by code under libmaple/usb/. These were moved into usb_config.h, and are clearly marked as being terrible hacks. I'm going to treat the USB stack as a black box that we'll deal with later. Further, instead of having a variety of #defines like "How many USARTS do I have?", we decide that based on the density of the chip. This is determined by testing for STM32_MEDIUM_DENSITY or STM32_HIGH_DENSITY defines. libmaple currently doesn't support low-density chips, so that suffices. The Makefile will set these automatically based on the MCU. Other offending #defines are ERROR_LED_PORT and ERROR_LED_PIN; these were made optional, but they're set in the Makefile as a hack to keep things working.
Diffstat (limited to 'libmaple/usb/descriptors.c')
-rw-r--r--libmaple/usb/descriptors.c73
1 files changed, 40 insertions, 33 deletions
diff --git a/libmaple/usb/descriptors.c b/libmaple/usb/descriptors.c
index 360e6dd..8dd9521 100644
--- a/libmaple/usb/descriptors.c
+++ b/libmaple/usb/descriptors.c
@@ -150,43 +150,50 @@ const USB_Descriptor_Config usbVcomDescriptor_Config = {
// }
};
-/*
- String Identifiers:
+/*****************************************************************************
+ *****************************************************************************
+ ***
+ *** FIXME FIXME FIXME NOT THE RIGHT THING! MOVE ALL THIS INTO TO WIRISH!
+ ***
+ *****************************************************************************
+ *****************************************************************************/
- we may choose to specify any or none of the following string
- identifiers:
+const uint8 usbVcomDescriptor_LangID[USB_DESCRIPTOR_STRING_LEN(1)] = {
+ USB_DESCRIPTOR_STRING_LEN(1),
+ USB_DESCRIPTOR_TYPE_STRING,
+ 0x09,
+ 0x04
+};
- iManufacturer: LeafLabs
- iProduct: Maple R3
- iSerialNumber: NONE
- iConfiguration: NONE
- iInterface(CCI): NONE
- iInterface(DCI): NONE
+const uint8 usbVcomDescriptor_iManufacturer[USB_DESCRIPTOR_STRING_LEN(8)] = {
+ USB_DESCRIPTOR_STRING_LEN(8),
+ USB_DESCRIPTOR_TYPE_STRING,
+ 'L', 0, 'e', 0, 'a', 0, 'f', 0,
+ 'L', 0, 'a', 0, 'b', 0, 's', 0
+};
- additionally we must provide the unicode language identifier,
- which is 0x0409 for US English
-*/
+/*
+ String Identifiers:
-const uint8 usbVcomDescriptor_LangID[USB_DESCRIPTOR_STRING_LEN(1)] =
-{
- USB_DESCRIPTOR_STRING_LEN(1),
- USB_DESCRIPTOR_TYPE_STRING,
- 0x09,
- 0x04
-};
+ we may choose to specify any or none of the following string
+ identifiers:
-const uint8 usbVcomDescriptor_iManufacturer[USB_DESCRIPTOR_STRING_LEN(8)] =
-{
- USB_DESCRIPTOR_STRING_LEN(8),
- USB_DESCRIPTOR_TYPE_STRING,
- 'L', 0, 'e', 0, 'a', 0, 'f', 0,
- 'L', 0, 'a', 0, 'b', 0, 's', 0
-};
+ iManufacturer: LeafLabs
+ iProduct: Maple R3
+ iSerialNumber: NONE
+ iConfiguration: NONE
+ iInterface(CCI): NONE
+ iInterface(DCI): NONE
-const uint8 usbVcomDescriptor_iProduct[USB_DESCRIPTOR_STRING_LEN(8)] =
-{
- USB_DESCRIPTOR_STRING_LEN(8),
- USB_DESCRIPTOR_TYPE_STRING,
- 'M', 0, 'a', 0, 'p', 0, 'l', 0,
- 'e', 0, ' ', 0, 'R', 0, '3', 0
+ additionally we must provide the unicode language identifier,
+ which is 0x0409 for US English
+*/
+const uint8 usbVcomDescriptor_iProduct[USB_DESCRIPTOR_STRING_LEN(8)] = {
+ USB_DESCRIPTOR_STRING_LEN(8),
+ USB_DESCRIPTOR_TYPE_STRING,
+ 'M', 0, 'a', 0, 'p', 0, 'l', 0,
+ 'e', 0, ' ', 0, ' ', 0, ' ', 0
};
+
+/*****************************************************************************
+ *****************************************************************************/