XDK API  3.6.0
Documentation
Data Structures | Macros | Functions | Variables
BSP_USB_Descriptors.h File Reference

USB descriptors for HID keyboard example project. More...

#include "em_usb.h"
#include "BCDS_USB.h"
+ Include dependency graph for BSP_USB_Descriptors.h:

Data Structures

struct  __attribute__
 

Macros

#define USB_CONFIG_TOTAL_DESCSIZE
 
#define USB_DELAY_LIMIT   UINT8_C(10)
 
#define USB_EP_DATA_IN   INT32_C(0x81)
 
#define USB_EP_DATA_OUT   INT32_C(0x01)
 
#define USB_EP_NOTIFY   INT32_C(0x82)
 
#define USB_ONE_MILLI_SECOND_DELAY   UINT8_C(1)
 
#define USB_SETUP_INDEX   UINT8_C(0) /* @see USB_Setup_TypeDef */
 
#define USB_SETUP_LENGTH   UINT8_C(7) /* @see USB_Setup_TypeDef */
 
#define USB_SETUP_NO_DATA_LENGTH   UINT8_C(0) /* @see USB_Setup_TypeDef */
 
#define USB_SETUP_VALUE   UINT8_C(0) /* @see USB_Setup_TypeDef */
 
#define USB_ZERO_VALUE   UINT8_C(0)
 
#define USBDESC_STR_LEN   20
 

Functions

static const
USB_DeviceDescriptor_TypeDef
USB_deviceDescriptor_mds 
__attribute__ ((aligned(4)))
 
 STATIC_CONST_STRING_DESC (USB_manufacturerName_gau, 'B','o','s','c','h',' ','C','o','n','n','e','c','t','e','d', ' ','D','e','v','i','c','e','s',' ','a','n','d',' ','S','o','l','u','t','i','o','n','s',' ','G','m','b','H')
 
 STATIC_CONST_STRING_DESC (USB_productName_gau, BCDS_PRODUCT_NAME)
 
 STATIC_CONST_STRING_DESC_LANGID (USB_langID_gau, 0x04, 0x09)
 
 STATIC_CONST_STRING_DESC_LANGID (langID, 0x04, 0x09)
 

Variables

static uint8_t USB_bufferingMultiplier_ma [NUM_EP_USED+1] = { 1, 1, 2, 2 }
 
static const USBD_Callbacks_TypeDef USB_callbacks_mds
 
static const USBD_Init_TypeDef USB_initStruct_mds
 
static const void *const USB_strings_ma []
 

Detailed Description

Author
Energy Micro AS
Version
1.03

License

(C) Copyright 2013 Energy Micro AS, http://www.energymicro.com

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
  4. The source and compiled code may only be used on Energy Micro "EFM32" microcontrollers and "EFR4" radios.

DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no obligation to support this Software. Energy Micro AS is providing the Software "AS IS", with no express or implied warranties of any kind, including, but not limited to, any implied warranties of merchantability or fitness for any particular purpose or warranties against infringement of any proprietary rights of a third party.

Energy Micro AS will not be liable for any consequential, incidental, or special damages, or any other relief, or for any claim by any third party, arising from your use of this Software.

Macro Definition Documentation

#define USB_CONFIG_TOTAL_DESCSIZE
Value:
( USB_CONFIG_DESCSIZE + \
(USB_INTERFACE_DESCSIZE * 2) + \
(USB_ENDPOINT_DESCSIZE * NUM_EP_USED) + \
USB_CDC_HEADER_FND_DESCSIZE + \
USB_CDC_CALLMNG_FND_DESCSIZE + \
USB_CDC_ACM_FND_DESCSIZE + \
5 )
#define NUM_EP_USED
Definition: usbconfig.h:71
#define USB_DELAY_LIMIT   UINT8_C(10)

Macro to represent the delay limit(10ms) when USB transfer is not done (since it takes 10ms(appx) to transmit 1kb delay limit is fixed as 10ms)

#define USB_EP_DATA_IN   INT32_C(0x81)

Endpoint for USB data transmission.

#define USB_EP_DATA_OUT   INT32_C(0x01)

Modified by Bosch Connected Devices and Solutions GmbH. Modifications are

  • Bosch specific vendor ID and Product ID
  • Project specific string descriptorEndpoint for USB data reception.
#define USB_EP_NOTIFY   INT32_C(0x82)

The notification endpoint (not used).

#define USB_ONE_MILLI_SECOND_DELAY   UINT8_C(1)

Macro to represent the one milli second delay

#define USB_SETUP_INDEX   UINT8_C(0) /* @see USB_Setup_TypeDef */
#define USB_SETUP_LENGTH   UINT8_C(7) /* @see USB_Setup_TypeDef */
#define USB_SETUP_NO_DATA_LENGTH   UINT8_C(0) /* @see USB_Setup_TypeDef */
#define USB_SETUP_VALUE   UINT8_C(0) /* @see USB_Setup_TypeDef */
#define USB_ZERO_VALUE   UINT8_C(0)

Macro to represent zero value

#define USBDESC_STR_LEN   20

Maximum length of USB Serial Number

Function Documentation

static const USB_DeviceDescriptor_TypeDef USB_deviceDescriptor_mds __attribute__ ( (aligned(4))  )
static
STATIC_CONST_STRING_DESC ( USB_manufacturerName_gau  ,
'B'  ,
'o'  ,
's'  ,
'c'  ,
'h'  ,
' '  ,
'C'  ,
'o'  ,
'n'  ,
'n'  ,
'e'  ,
'c'  ,
't'  ,
'e'  ,
'd'  ,
' '  ,
'D'  ,
'e'  ,
'v'  ,
'i'  ,
'c'  ,
'e'  ,
's'  ,
' '  ,
'a'  ,
'n'  ,
'd'  ,
' '  ,
'S'  ,
'o'  ,
'l'  ,
'u'  ,
't'  ,
'i'  ,
'o'  ,
'n'  ,
's'  ,
' '  ,
'G'  ,
'm'  ,
'b'  ,
'H'   
)

Manufacturer name

STATIC_CONST_STRING_DESC ( USB_productName_gau  ,
BCDS_PRODUCT_NAME   
)

Product name

STATIC_CONST_STRING_DESC_LANGID ( USB_langID_gau  ,
0x04  ,
0x09   
)

Macro for creating USB compliant language string descriptors

STATIC_CONST_STRING_DESC_LANGID ( langID  ,
0x04  ,
0x09   
)

Variable Documentation

uint8_t USB_bufferingMultiplier_ma[NUM_EP_USED+1] = { 1, 1, 2, 2 }
static
const USBD_Callbacks_TypeDef USB_callbacks_mds
static
Initial value:
=
{
.usbReset = NULL,
.usbStateChange = USB_stateChange,
.setupCmd = USB_setupCommand,
.isSelfPowered = NULL,
.sofInt = NULL
}
void USB_stateChange(USBD_State_TypeDef oldState, USBD_State_TypeDef newState)
Called each time the USB device state is changed. Starts CDC operation when device has been configure...
#define NULL
Definition: BCDS_Basics.h:80
int USB_setupCommand(const USB_Setup_TypeDef *setup)
Called each time the USB host sends a SETUP command. Implements CDC class specific commands...
const USBD_Init_TypeDef USB_initStruct_mds
static
Initial value:
=
{
.deviceDescriptor = &USB_deviceDescriptor_mds,
.configDescriptor = USB_configDescriptor_ma,
.stringDescriptors = USB_strings_ma,
.numberOfStrings = sizeof(USB_strings_ma) / sizeof(void*),
.bufferingMultiplier = USB_bufferingMultiplier_ma,
.callbacks = &USB_callbacks_mds,
.reserved = UINT32_C(0)
}
static const USBD_Callbacks_TypeDef USB_callbacks_mds
Definition: BSP_USB_Descriptors.h:226
static const void *const USB_strings_ma[]
Definition: BSP_USB_Descriptors.h:214
static uint8_t USB_bufferingMultiplier_ma[NUM_EP_USED+1]
Definition: BSP_USB_Descriptors.h:225
const void* const USB_strings_ma[]
static
Initial value:
=
{
&langID,
&USB_manufacturerName_gau,
&USB_productName_gau,
&USB_serialnumber_gau
}

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:48 by doxygen 1.8.8