summaryrefslogtreecommitdiff
path: root/stm32cubemx/Src
diff options
context:
space:
mode:
Diffstat (limited to 'stm32cubemx/Src')
-rw-r--r--stm32cubemx/Src/main.c49
-rw-r--r--stm32cubemx/Src/stm32f1xx_hal_msp.c50
-rw-r--r--stm32cubemx/Src/stm32f1xx_it.c2
-rw-r--r--stm32cubemx/Src/system_stm32f1xx.c150
-rw-r--r--stm32cubemx/Src/usb_device.c38
-rw-r--r--stm32cubemx/Src/usbd_cdc_if.c124
-rw-r--r--stm32cubemx/Src/usbd_conf.c168
-rw-r--r--stm32cubemx/Src/usbd_desc.c118
8 files changed, 349 insertions, 350 deletions
diff --git a/stm32cubemx/Src/main.c b/stm32cubemx/Src/main.c
index e0e60be..7c5f9d3 100644
--- a/stm32cubemx/Src/main.c
+++ b/stm32cubemx/Src/main.c
@@ -4,44 +4,43 @@
* Description : Main program body
******************************************************************************
*
- * Copyright (c) 2017 STMicroelectronics International N.V.
+ * Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
- * 1. Redistribution of source code must retain the above copyright notice,
+ * 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
+ * 3. Neither the name of STMicroelectronics nor the names of other
+ * contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
+ * 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
+ * 5. Redistribution and use of this software other than as permitted under
+ * this license is void and will automatically terminate your rights under
+ * this license.
*
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
-#include <inttypes.h>
#include "main.h"
#include "stm32f1xx_hal.h"
#include "usb_device.h"
@@ -126,7 +125,7 @@ void SystemClock_Config(void)
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInit;
- /**Initializes the CPU, AHB and APB busses clocks
+ /**Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
@@ -140,7 +139,7 @@ void SystemClock_Config(void)
Error_Handler();
}
- /**Initializes the CPU, AHB and APB busses clocks
+ /**Initializes the CPU, AHB and APB busses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
@@ -161,11 +160,11 @@ void SystemClock_Config(void)
Error_Handler();
}
- /**Configure the Systick interrupt time
+ /**Configure the Systick interrupt time
*/
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
- /**Configure the Systick
+ /**Configure the Systick
*/
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
@@ -218,7 +217,7 @@ static void MX_TIM1_Init(void)
}
-/**
+/**
* Enable DMA controller clock
*/
static void MX_DMA_Init(void)
@@ -233,9 +232,9 @@ static void MX_DMA_Init(void)
}
-/** Configure pins as
- * Analog
- * Input
+/** Configure pins as
+ * Analog
+ * Input
* Output
* EVENT_OUT
* EXTI
diff --git a/stm32cubemx/Src/stm32f1xx_hal_msp.c b/stm32cubemx/Src/stm32f1xx_hal_msp.c
index f0cb212..eefddb9 100644
--- a/stm32cubemx/Src/stm32f1xx_hal_msp.c
+++ b/stm32cubemx/Src/stm32f1xx_hal_msp.c
@@ -1,41 +1,41 @@
/**
******************************************************************************
* File Name : stm32f1xx_hal_msp.c
- * Description : This file provides code for the MSP Initialization
+ * Description : This file provides code for the MSP Initialization
* and de-Initialization codes.
******************************************************************************
*
- * Copyright (c) 2017 STMicroelectronics International N.V.
+ * Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
- * 1. Redistribution of source code must retain the above copyright notice,
+ * 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
+ * 3. Neither the name of STMicroelectronics nor the names of other
+ * contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
+ * 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
+ * 5. Redistribution and use of this software other than as permitted under
+ * this license is void and will automatically terminate your rights under
+ * this license.
*
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
@@ -79,7 +79,7 @@ void HAL_MspInit(void)
/* SysTick_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
- /**NOJTAG: JTAG-DP Disabled and SW-DP Enabled
+ /**NOJTAG: JTAG-DP Disabled and SW-DP Enabled
*/
__HAL_AFIO_REMAP_SWJ_NOJTAG();
@@ -99,9 +99,9 @@ void HAL_TIM_IC_MspInit(TIM_HandleTypeDef* htim_ic)
/* USER CODE END TIM1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM1_CLK_ENABLE();
-
- /**TIM1 GPIO Configuration
- PA8 ------> TIM1_CH1
+
+ /**TIM1 GPIO Configuration
+ PA8 ------> TIM1_CH1
*/
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
@@ -109,7 +109,7 @@ void HAL_TIM_IC_MspInit(TIM_HandleTypeDef* htim_ic)
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* Peripheral DMA init*/
-
+
hdma_tim1_ch1.Instance = DMA1_Channel2;
hdma_tim1_ch1.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_tim1_ch1.Init.PeriphInc = DMA_PINC_DISABLE;
@@ -142,9 +142,9 @@ void HAL_TIM_IC_MspDeInit(TIM_HandleTypeDef* htim_ic)
/* USER CODE END TIM1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM1_CLK_DISABLE();
-
- /**TIM1 GPIO Configuration
- PA8 ------> TIM1_CH1
+
+ /**TIM1 GPIO Configuration
+ PA8 ------> TIM1_CH1
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_8);
diff --git a/stm32cubemx/Src/stm32f1xx_it.c b/stm32cubemx/Src/stm32f1xx_it.c
index 02f62b2..83f5436 100644
--- a/stm32cubemx/Src/stm32f1xx_it.c
+++ b/stm32cubemx/Src/stm32f1xx_it.c
@@ -45,7 +45,7 @@ extern DMA_HandleTypeDef hdma_tim1_ch1;
extern TIM_HandleTypeDef htim1;
/******************************************************************************/
-/* Cortex-M3 Processor Interruption and Exception Handlers */
+/* Cortex-M3 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
diff --git a/stm32cubemx/Src/system_stm32f1xx.c b/stm32cubemx/Src/system_stm32f1xx.c
index 0ca6174..9d07f89 100644
--- a/stm32cubemx/Src/system_stm32f1xx.c
+++ b/stm32cubemx/Src/system_stm32f1xx.c
@@ -5,19 +5,19 @@
* @version V4.1.0
* @date 29-April-2016
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
- *
- * 1. This file provides two functions and one global variable to be called from
+ *
+ * 1. This file provides two functions and one global variable to be called from
* user application:
* - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
- * factors, AHB/APBx prescalers and Flash settings).
- * This function is called at startup just after reset and
+ * factors, AHB/APBx prescalers and Flash settings).
+ * This function is called at startup just after reset and
* before branch to main program. This call is made inside
* the "startup_stm32f1xx_xx.s" file.
*
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
- * by the user application to setup the SysTick
+ * by the user application to setup the SysTick
* timer or configure other parameters.
- *
+ *
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
* be called whenever the core clock is changed
* during program execution.
@@ -27,11 +27,11 @@
* configure the system clock before to branch to main program.
*
* 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depending on
- * the product used), refer to "HSE_VALUE".
+ * the product used), refer to "HSE_VALUE".
* When HSE is used as system clock source, directly or through PLL, and you
* are using different crystal you have to adapt the HSE value to your own
* configuration.
- *
+ *
******************************************************************************
* @attention
*
@@ -68,8 +68,8 @@
/** @addtogroup stm32f1xx_system
* @{
- */
-
+ */
+
/** @addtogroup STM32F1xx_System_Private_Includes
* @{
*/
@@ -92,7 +92,7 @@
* @{
*/
-#if !defined (HSE_VALUE)
+#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz.
This value can be provided and adapted by the user application. */
#endif /* HSE_VALUE */
@@ -102,15 +102,15 @@
This value can be provided and adapted by the user application. */
#endif /* HSI_VALUE */
-/*!< Uncomment the following line if you need to use external SRAM */
+/*!< Uncomment the following line if you need to use external SRAM */
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
/* #define DATA_IN_ExtSRAM */
#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
/*!< Uncomment the following line if you need to relocate your vector Table in
- Internal SRAM. */
+ Internal SRAM. */
/* #define VECT_TAB_SRAM */
-#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
+#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
@@ -152,7 +152,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
#ifdef DATA_IN_ExtSRAM
- static void SystemInit_ExtMemCtl(void);
+ static void SystemInit_ExtMemCtl(void);
#endif /* DATA_IN_ExtSRAM */
#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
@@ -166,7 +166,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
/**
* @brief Setup the microcontroller system
- * Initialize the Embedded Flash Interface, the PLL and update the
+ * Initialize the Embedded Flash Interface, the PLL and update the
* SystemCoreClock variable.
* @note This function should be used only after reset.
* @param None
@@ -183,8 +183,8 @@ void SystemInit (void)
RCC->CFGR &= (uint32_t)0xF8FF0000;
#else
RCC->CFGR &= (uint32_t)0xF0FF0000;
-#endif /* STM32F105xC */
-
+#endif /* STM32F105xC */
+
/* Reset HSEON, CSSON and PLLON bits */
RCC->CR &= (uint32_t)0xFEF6FFFF;
@@ -208,23 +208,23 @@ void SystemInit (void)
RCC->CIR = 0x009F0000;
/* Reset CFGR2 register */
- RCC->CFGR2 = 0x00000000;
+ RCC->CFGR2 = 0x00000000;
#else
/* Disable all interrupts and clear pending bits */
RCC->CIR = 0x009F0000;
#endif /* STM32F105xC */
-
+
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
#ifdef DATA_IN_ExtSRAM
- SystemInit_ExtMemCtl();
+ SystemInit_ExtMemCtl();
#endif /* DATA_IN_ExtSRAM */
-#endif
+#endif
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
#else
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
-#endif
+#endif
}
/**
@@ -232,31 +232,31 @@ void SystemInit (void)
* The SystemCoreClock variable contains the core clock (HCLK), it can
* be used by the user application to setup the SysTick timer or configure
* other parameters.
- *
+ *
* @note Each time the core clock (HCLK) changes, this function must be called
* to update SystemCoreClock variable value. Otherwise, any configuration
- * based on this variable will be incorrect.
- *
- * @note - The system frequency computed by this function is not the real
- * frequency in the chip. It is calculated based on the predefined
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
* constant and the selected clock source:
- *
+ *
* - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
- *
+ *
* - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
- *
- * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
* or HSI_VALUE(*) multiplied by the PLL factors.
- *
+ *
* (*) HSI_VALUE is a constant defined in stm32f1xx.h file (default value
* 8 MHz) but the real value may vary depending on the variations
- * in voltage and temperature.
- *
+ * in voltage and temperature.
+ *
* (**) HSE_VALUE is a constant defined in stm32f1xx.h file (default value
* 8 MHz or 25 MHz, depending on the product used), user has to ensure
* that HSE_VALUE is same as the real frequency of the crystal used.
* Otherwise, this function may have wrong result.
- *
+ *
* - The result of this function could be not correct when using fractional
* value for HSE crystal.
* @param None
@@ -273,10 +273,10 @@ void SystemCoreClockUpdate (void)
#if defined(STM32F100xB) || defined(STM32F100xE)
uint32_t prediv1factor = 0;
#endif /* STM32F100xB or STM32F100xE */
-
+
/* Get SYSCLK source -------------------------------------------------------*/
tmp = RCC->CFGR & RCC_CFGR_SWS;
-
+
switch (tmp)
{
case 0x00: /* HSI used as system clock */
@@ -290,10 +290,10 @@ void SystemCoreClockUpdate (void)
/* Get PLL clock source and multiplication factor ----------------------*/
pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
-
-#if !defined(STM32F105xC) && !defined(STM32F107xC)
+
+#if !defined(STM32F105xC) && !defined(STM32F107xC)
pllmull = ( pllmull >> 18) + 2;
-
+
if (pllsource == 0x00)
{
/* HSI oscillator clock divided by 2 selected as PLL clock entry */
@@ -304,7 +304,7 @@ void SystemCoreClockUpdate (void)
#if defined(STM32F100xB) || defined(STM32F100xE)
prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
/* HSE oscillator clock selected as PREDIV1 clock entry */
- SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
+ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
#else
/* HSE selected as PLL clock entry */
if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)
@@ -319,16 +319,16 @@ void SystemCoreClockUpdate (void)
}
#else
pllmull = pllmull >> 18;
-
+
if (pllmull != 0x0D)
{
pllmull += 2;
}
else
{ /* PLL multiplication factor = PLL input clock * 6.5 */
- pllmull = 13 / 2;
+ pllmull = 13 / 2;
}
-
+
if (pllsource == 0x00)
{
/* HSI oscillator clock divided by 2 selected as PLL clock entry */
@@ -336,61 +336,61 @@ void SystemCoreClockUpdate (void)
}
else
{/* PREDIV1 selected as PLL clock entry */
-
+
/* Get PREDIV1 clock source and division factor */
prediv1source = RCC->CFGR2 & RCC_CFGR2_PREDIV1SRC;
prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
-
+
if (prediv1source == 0)
- {
+ {
/* HSE oscillator clock selected as PREDIV1 clock entry */
- SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
+ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
}
else
{/* PLL2 clock selected as PREDIV1 clock entry */
-
+
/* Get PREDIV2 division factor and PLL2 multiplication factor */
prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4) + 1;
- pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8 ) + 2;
- SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;
+ pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8 ) + 2;
+ SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;
}
}
-#endif /* STM32F105xC */
+#endif /* STM32F105xC */
break;
default:
SystemCoreClock = HSI_VALUE;
break;
}
-
+
/* Compute HCLK clock frequency ----------------*/
/* Get HCLK prescaler */
tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
/* HCLK clock frequency */
- SystemCoreClock >>= tmp;
+ SystemCoreClock >>= tmp;
}
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
/**
- * @brief Setup the external memory controller. Called in startup_stm32f1xx.s
+ * @brief Setup the external memory controller. Called in startup_stm32f1xx.s
* before jump to __main
* @param None
* @retval None
- */
+ */
#ifdef DATA_IN_ExtSRAM
/**
- * @brief Setup the external memory controller.
+ * @brief Setup the external memory controller.
* Called in startup_stm32f1xx_xx.s/.c before jump to main.
* This function configures the external SRAM mounted on STM3210E-EVAL
* board (STM32 High density devices). This SRAM will be used as program
* data memory (including heap and stack).
* @param None
* @retval None
- */
-void SystemInit_ExtMemCtl(void)
+ */
+void SystemInit_ExtMemCtl(void)
{
__IO uint32_t tmpreg;
- /*!< FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is
+ /*!< FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is
required, then adjust the Register Addresses */
/* Enable FSMC clock */
@@ -398,36 +398,36 @@ void SystemInit_ExtMemCtl(void)
/* Delay after an RCC peripheral clock enabling */
tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);
-
+
/* Enable GPIOD, GPIOE, GPIOF and GPIOG clocks */
RCC->APB2ENR = 0x000001E0;
-
+
/* Delay after an RCC peripheral clock enabling */
tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPDEN);
(void)(tmpreg);
-
+
/* --------------- SRAM Data lines, NOE and NWE configuration ---------------*/
/*---------------- SRAM Address lines configuration -------------------------*/
-/*---------------- NOE and NWE configuration --------------------------------*/
+/*---------------- NOE and NWE configuration --------------------------------*/
/*---------------- NE3 configuration ----------------------------------------*/
/*---------------- NBL0, NBL1 configuration ---------------------------------*/
-
- GPIOD->CRL = 0x44BB44BB;
+
+ GPIOD->CRL = 0x44BB44BB;
GPIOD->CRH = 0xBBBBBBBB;
- GPIOE->CRL = 0xB44444BB;
+ GPIOE->CRL = 0xB44444BB;
GPIOE->CRH = 0xBBBBBBBB;
- GPIOF->CRL = 0x44BBBBBB;
+ GPIOF->CRL = 0x44BBBBBB;
GPIOF->CRH = 0xBBBB4444;
- GPIOG->CRL = 0x44BBBBBB;
+ GPIOG->CRL = 0x44BBBBBB;
GPIOG->CRH = 0x444B4B44;
-
-/*---------------- FSMC Configuration ---------------------------------------*/
+
+/*---------------- FSMC Configuration ---------------------------------------*/
/*---------------- Enable FSMC Bank1_SRAM Bank ------------------------------*/
-
+
FSMC_Bank1->BTCR[4] = 0x00001091;
FSMC_Bank1->BTCR[5] = 0x00110212;
}
@@ -441,8 +441,8 @@ void SystemInit_ExtMemCtl(void)
/**
* @}
*/
-
+
/**
* @}
- */
+ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/stm32cubemx/Src/usb_device.c b/stm32cubemx/Src/usb_device.c
index 2a51b5e..0e0ed5b 100644
--- a/stm32cubemx/Src/usb_device.c
+++ b/stm32cubemx/Src/usb_device.c
@@ -1,41 +1,41 @@
/**
******************************************************************************
- * @file : USB_DEVICE
+ * @file : USB_DEVICE
* @version : v2.0_Cube
- * @brief : This file implements the USB Device
+ * @brief : This file implements the USB Device
******************************************************************************
*
- * Copyright (c) 2017 STMicroelectronics International N.V.
+ * Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
- * 1. Redistribution of source code must retain the above copyright notice,
+ * 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
+ * 3. Neither the name of STMicroelectronics nor the names of other
+ * contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
+ * 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
+ * 5. Redistribution and use of this software other than as permitted under
+ * this license is void and will automatically terminate your rights under
+ * this license.
*
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
@@ -53,7 +53,7 @@
/* USB Device Core handle declaration */
USBD_HandleTypeDef hUsbDeviceFS;
-/* init function */
+/* init function */
void MX_USB_DEVICE_Init(void)
{
/* Init Device Library,Add Supported Class and Start the library*/
diff --git a/stm32cubemx/Src/usbd_cdc_if.c b/stm32cubemx/Src/usbd_cdc_if.c
index a468e94..6e6d192 100644
--- a/stm32cubemx/Src/usbd_cdc_if.c
+++ b/stm32cubemx/Src/usbd_cdc_if.c
@@ -4,37 +4,37 @@
* @brief :
******************************************************************************
*
- * Copyright (c) 2017 STMicroelectronics International N.V.
+ * Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
- * 1. Redistribution of source code must retain the above copyright notice,
+ * 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
+ * 3. Neither the name of STMicroelectronics nor the names of other
+ * contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
+ * 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
+ * 5. Redistribution and use of this software other than as permitted under
+ * this license is void and will automatically terminate your rights under
+ * this license.
*
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
@@ -50,7 +50,7 @@
* @{
*/
-/** @defgroup USBD_CDC
+/** @defgroup USBD_CDC
* @brief usbd core module
* @{
*/
@@ -174,7 +174,7 @@ static int8_t CDC_DeInit_FS(void)
/**
* @brief CDC_Control_FS
* Manage the CDC class requests
- * @param cmd: Command code
+ * @param cmd: Command code
* @param pbuf: Buffer containing command data (request parameters)
* @param length: Number of data to be sent (in bytes)
* @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
@@ -186,42 +186,42 @@ static int8_t CDC_Control_FS (uint8_t cmd, uint8_t* pbuf, uint16_t length)
{
case CDC_SEND_ENCAPSULATED_COMMAND:
- break;
+ break;
case CDC_GET_ENCAPSULATED_RESPONSE:
- break;
+ break;
- case CDC_SET_COMM_FEATURE:
+ case CDC_SET_COMM_FEATURE:
- break;
+ break;
- case CDC_GET_COMM_FEATURE:
+ case CDC_GET_COMM_FEATURE:
- break;
+ break;
- case CDC_CLEAR_COMM_FEATURE:
+ case CDC_CLEAR_COMM_FEATURE:
- break;
+ break;
- /*******************************************************************************/
- /* Line Coding Structure */
- /*-----------------------------------------------------------------------------*/
- /* Offset | Field | Size | Value | Description */
- /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/
- /* 4 | bCharFormat | 1 | Number | Stop bits */
- /* 0 - 1 Stop bit */
- /* 1 - 1.5 Stop bits */
- /* 2 - 2 Stop bits */
- /* 5 | bParityType | 1 | Number | Parity */
- /* 0 - None */
- /* 1 - Odd */
- /* 2 - Even */
- /* 3 - Mark */
- /* 4 - Space */
- /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */
- /*******************************************************************************/
- case CDC_SET_LINE_CODING: {
+ /*******************************************************************************/
+ /* Line Coding Structure */
+ /*-----------------------------------------------------------------------------*/
+ /* Offset | Field | Size | Value | Description */
+ /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/
+ /* 4 | bCharFormat | 1 | Number | Stop bits */
+ /* 0 - 1 Stop bit */
+ /* 1 - 1.5 Stop bits */
+ /* 2 - 2 Stop bits */
+ /* 5 | bParityType | 1 | Number | Parity */
+ /* 0 - None */
+ /* 1 - Odd */
+ /* 2 - Even */
+ /* 3 - Mark */
+ /* 4 - Space */
+ /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */
+ /*******************************************************************************/
+ case CDC_SET_LINE_CODING: {
uint32_t bps = pbuf[0] << 24 | pbuf[1] << 16 | pbuf[2] << 8 | pbuf[3];
const char *stop_bits = pbuf[4] == 0 ? "1" : pbuf[4] == 1 ? "1.5" : "2";
const char *parities[5] = {"none", "odd", "even", "mark", "space"};
@@ -229,22 +229,22 @@ static int8_t CDC_Control_FS (uint8_t cmd, uint8_t* pbuf, uint16_t length)
int bits = pbuf[6];
printf("Line coding, bps=%lu, bits=%s, parity=%s, bits=%d\n", bps, stop_bits, parity, bits);
}
- break;
+ break;
- case CDC_GET_LINE_CODING:
+ case CDC_GET_LINE_CODING:
- break;
+ break;
- case CDC_SET_CONTROL_LINE_STATE:
+ case CDC_SET_CONTROL_LINE_STATE:
- break;
+ break;
- case CDC_SEND_BREAK:
+ case CDC_SEND_BREAK:
- break;
+ break;
- default:
- break;
+ default:
+ break;
}
return (USBD_OK);
@@ -253,15 +253,15 @@ static int8_t CDC_Control_FS (uint8_t cmd, uint8_t* pbuf, uint16_t length)
/**
* @brief CDC_Receive_FS
- * Data received over USB OUT endpoint are sent over CDC interface
+ * Data received over USB OUT endpoint are sent over CDC interface
* through this function.
- *
+ *
* @note
- * This function will block any OUT packet reception on USB endpoint
+ * This function will block any OUT packet reception on USB endpoint
* untill exiting this function. If you exit this function before transfer
- * is complete on CDC interface (ie. using DMA controller) it will result
+ * is complete on CDC interface (ie. using DMA controller) it will result
* in receiving more data while previous ones are still not sent.
- *
+ *
* @param Buf: Buffer of data to be received
* @param Len: Number of data received (in bytes)
* @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
@@ -284,11 +284,11 @@ static int8_t CDC_Receive_FS (uint8_t* Buf, uint32_t *Len)
/**
* @brief CDC_Transmit_FS
- * Data send over USB IN endpoint are sent over CDC interface
- * through this function.
+ * Data send over USB IN endpoint are sent over CDC interface
+ * through this function.
* @note
- *
- *
+ *
+ *
* @param Buf: Buffer of data to be send
* @param Len: Number of data to be send (in bytes)
* @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL or USBD_BUSY
diff --git a/stm32cubemx/Src/usbd_conf.c b/stm32cubemx/Src/usbd_conf.c
index 61661bf..36db934 100644
--- a/stm32cubemx/Src/usbd_conf.c
+++ b/stm32cubemx/Src/usbd_conf.c
@@ -5,37 +5,37 @@
* @brief : This file implements the board support package for the USB device library
******************************************************************************
*
- * Copyright (c) 2017 STMicroelectronics International N.V.
+ * Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
- * 1. Redistribution of source code must retain the above copyright notice,
+ * 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
+ * 3. Neither the name of STMicroelectronics nor the names of other
+ * contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
+ * 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
+ * 5. Redistribution and use of this software other than as permitted under
+ * this license is void and will automatically terminate your rights under
+ * this license.
*
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
@@ -158,22 +158,22 @@ void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd)
* @retval None
*/
void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd)
-{
+{
USBD_SpeedTypeDef speed = USBD_SPEED_FULL;
/*Set USB Current Speed*/
switch (hpcd->Init.speed)
{
case PCD_SPEED_FULL:
- speed = USBD_SPEED_FULL;
+ speed = USBD_SPEED_FULL;
break;
default:
- speed = USBD_SPEED_FULL;
- break;
+ speed = USBD_SPEED_FULL;
+ break;
}
- USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed);
-
+ USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed);
+
/*Reset Device*/
USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData);
}
@@ -189,7 +189,7 @@ void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd)
/* Inform USB library that core enters in suspend Mode */
USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData);
/*Enter in STOP mode */
- /* USER CODE BEGIN 2 */
+ /* USER CODE BEGIN 2 */
if (hpcd->Init.low_power_enable)
{
/* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register */
@@ -209,7 +209,7 @@ void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd)
/* USER CODE BEGIN 3 */
/* USER CODE END 3 */
USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData);
-
+
}
/**
@@ -263,7 +263,7 @@ void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd)
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
-{
+{
/* Init USB_IP */
/* Link The driver to the stack */
hpcd_USB_FS.pData = pdev;
@@ -283,9 +283,9 @@ USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
- HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0);
+ HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110);
- HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100);
+ HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100);
return USBD_OK;
}
@@ -298,9 +298,9 @@ USBD_StatusTypeDef USBD_LL_DeInit (USBD_HandleTypeDef *pdev)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_DeInit(pdev->pData);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -318,11 +318,11 @@ USBD_StatusTypeDef USBD_LL_DeInit (USBD_HandleTypeDef *pdev)
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
- * @brief Starts the Low Level portion of the Device driver.
+ * @brief Starts the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
@@ -330,9 +330,9 @@ USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_Start(pdev->pData);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -350,7 +350,7 @@ USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev)
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -362,9 +362,9 @@ USBD_StatusTypeDef USBD_LL_Stop (USBD_HandleTypeDef *pdev)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_Stop(pdev->pData);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -382,7 +382,7 @@ USBD_StatusTypeDef USBD_LL_Stop (USBD_HandleTypeDef *pdev)
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -393,20 +393,20 @@ USBD_StatusTypeDef USBD_LL_Stop (USBD_HandleTypeDef *pdev)
* @param ep_mps: Endpoint Max Packet Size
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev,
- uint8_t ep_addr,
+USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev,
+ uint8_t ep_addr,
uint8_t ep_type,
uint16_t ep_mps)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
- hal_status = HAL_PCD_EP_Open(pdev->pData,
- ep_addr,
- ep_mps,
+ hal_status = HAL_PCD_EP_Open(pdev->pData,
+ ep_addr,
+ ep_mps,
ep_type);
-
-
+
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -424,7 +424,7 @@ USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev,
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -433,13 +433,13 @@ USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev,
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
+USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_EP_Close(pdev->pData, ep_addr);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -457,7 +457,7 @@ USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -466,13 +466,13 @@ USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
+USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_EP_Flush(pdev->pData, ep_addr);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -490,7 +490,7 @@ USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -499,13 +499,13 @@ USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
+USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -523,7 +523,7 @@ USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -532,13 +532,13 @@ USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
+USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
- hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr);
-
+
+ hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr);
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -556,7 +556,7 @@ USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_a
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -565,17 +565,17 @@ USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_a
* @param ep_addr: Endpoint Number
* @retval Stall (1: Yes, 0: No)
*/
-uint8_t USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
+uint8_t USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef*) pdev->pData;
-
+
if((ep_addr & 0x80) == 0x80)
{
- return hpcd->IN_ep[ep_addr & 0x7F].is_stall;
+ return hpcd->IN_ep[ep_addr & 0x7F].is_stall;
}
else
{
- return hpcd->OUT_ep[ep_addr & 0x7F].is_stall;
+ return hpcd->OUT_ep[ep_addr & 0x7F].is_stall;
}
}
/**
@@ -584,13 +584,13 @@ uint8_t USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev_addr)
+USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
-
+
hal_status = HAL_PCD_SetAddress(pdev->pData, dev_addr);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -608,7 +608,7 @@ USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -616,11 +616,11 @@ USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @param pbuf: Pointer to data to be sent
- * @param size: Data size
+ * @param size: Data size
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev,
- uint8_t ep_addr,
+USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev,
+ uint8_t ep_addr,
uint8_t *pbuf,
uint16_t size)
{
@@ -628,7 +628,7 @@ USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev,
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Transmit(pdev->pData, ep_addr, pbuf, size);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -646,7 +646,7 @@ USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev,
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -657,8 +657,8 @@ USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev,
* @param size: Data size
* @retval USBD Status
*/
-USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
- uint8_t ep_addr,
+USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
+ uint8_t ep_addr,
uint8_t *pbuf,
uint16_t size)
{
@@ -666,7 +666,7 @@ USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Receive(pdev->pData, ep_addr, pbuf, size);
-
+
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
@@ -684,7 +684,7 @@ USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
usb_status = USBD_FAIL;
break;
}
- return usb_status;
+ return usb_status;
}
/**
@@ -693,7 +693,7 @@ USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
* @param ep_addr: Endpoint Number
* @retval Recived Data Size
*/
-uint32_t USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
+uint32_t USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
return HAL_PCD_EP_GetRxCount((PCD_HandleTypeDef*) pdev->pData, ep_addr);
}
@@ -705,7 +705,7 @@ uint32_t USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
*/
void USBD_LL_Delay (uint32_t Delay)
{
- HAL_Delay(Delay);
+ HAL_Delay(Delay);
}
/**
@@ -732,7 +732,7 @@ void USBD_static_free(void *p)
/**
* @brief Software Device Connection
* @param hpcd: PCD handle
-* @param state: connection state (0 : disconnected / 1: connected)
+* @param state: connection state (0 : disconnected / 1: connected)
* @retval None
*/
void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state)
@@ -746,8 +746,8 @@ void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state)
else
{
/* Configure High Connection State */
-
- }
+
+ }
/* USER CODE END 5 */
}
diff --git a/stm32cubemx/Src/usbd_desc.c b/stm32cubemx/Src/usbd_desc.c
index b153354..432c1d4 100644
--- a/stm32cubemx/Src/usbd_desc.c
+++ b/stm32cubemx/Src/usbd_desc.c
@@ -5,37 +5,37 @@
* @brief : This file implements the USB Device descriptors
******************************************************************************
*
- * Copyright (c) 2017 STMicroelectronics International N.V.
+ * Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
+ * Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
- * 1. Redistribution of source code must retain the above copyright notice,
+ * 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * 3. Neither the name of STMicroelectronics nor the names of other
- * contributors to this software may be used to endorse or promote products
+ * 3. Neither the name of STMicroelectronics nor the names of other
+ * contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
- * 4. This software, including modifications and/or derivative works of this
+ * 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
- * 5. Redistribution and use of this software other than as permitted under
- * this license is void and will automatically terminate your rights under
- * this license.
+ * 5. Redistribution and use of this software other than as permitted under
+ * this license is void and will automatically terminate your rights under
+ * this license.
*
- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
@@ -51,21 +51,21 @@
* @{
*/
-/** @defgroup USBD_DESC
+/** @defgroup USBD_DESC
* @brief USBD descriptors module
* @{
- */
+ */
/** @defgroup USBD_DESC_Private_TypesDefinitions
* @{
- */
+ */
/**
* @}
- */
+ */
/** @defgroup USBD_DESC_Private_Defines
* @{
- */
+ */
#define USBD_VID 1155
#define USBD_LANGID_STRING 1033
#define USBD_MANUFACTURER_STRING "STMicroelectronics"
@@ -80,18 +80,18 @@
/* USER CODE END 0*/
/**
* @}
- */
+ */
/** @defgroup USBD_DESC_Private_Macros
* @{
- */
+ */
/**
* @}
- */
+ */
/** @defgroup USBD_DESC_Private_Variables
* @{
- */
+ */
uint8_t * USBD_FS_DeviceDescriptor( USBD_SpeedTypeDef speed , uint16_t *length);
uint8_t * USBD_FS_LangIDStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length);
uint8_t * USBD_FS_ManufacturerStrDescriptor ( USBD_SpeedTypeDef speed , uint16_t *length);
@@ -101,13 +101,13 @@ uint8_t * USBD_FS_ConfigStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *l
uint8_t * USBD_FS_InterfaceStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length);
#ifdef USB_SUPPORT_USER_STRING_DESC
-uint8_t * USBD_FS_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx , uint16_t *length);
-#endif /* USB_SUPPORT_USER_STRING_DESC */
+uint8_t * USBD_FS_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx , uint16_t *length);
+#endif /* USB_SUPPORT_USER_STRING_DESC */
USBD_DescriptorsTypeDef FS_Desc =
{
USBD_FS_DeviceDescriptor,
- USBD_FS_LangIDStrDescriptor,
+ USBD_FS_LangIDStrDescriptor,
USBD_FS_ManufacturerStrDescriptor,
USBD_FS_ProductStrDescriptor,
USBD_FS_SerialStrDescriptor,
@@ -116,14 +116,14 @@ USBD_DescriptorsTypeDef FS_Desc =
};
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
- #pragma data_alignment=4
+ #pragma data_alignment=4
#endif
/* USB Standard Device Descriptor */
__ALIGN_BEGIN uint8_t USBD_FS_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END =
{
0x12, /*bLength */
USB_DESC_TYPE_DEVICE, /*bDescriptorType*/
- 0x00, /* bcdUSB */
+ 0x00, /* bcdUSB */
0x02,
0x02, /*bDeviceClass*/
0x02, /*bDeviceSubClass*/
@@ -139,43 +139,43 @@ __ALIGN_BEGIN uint8_t USBD_FS_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END =
USBD_IDX_PRODUCT_STR, /*Index of product string*/
USBD_IDX_SERIAL_STR, /*Index of serial number string*/
USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/
- } ;
+ } ;
/* USB_DeviceDescriptor */
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
- #pragma data_alignment=4
+ #pragma data_alignment=4
#endif
/* USB Standard Device Descriptor */
__ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_LEN_LANGID_STR_DESC] __ALIGN_END =
{
- USB_LEN_LANGID_STR_DESC,
- USB_DESC_TYPE_STRING,
+ USB_LEN_LANGID_STR_DESC,
+ USB_DESC_TYPE_STRING,
LOBYTE(USBD_LANGID_STRING),
- HIBYTE(USBD_LANGID_STRING),
+ HIBYTE(USBD_LANGID_STRING),
};
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
- #pragma data_alignment=4
+ #pragma data_alignment=4
#endif
__ALIGN_BEGIN uint8_t USBD_StrDesc[USBD_MAX_STR_DESC_SIZ] __ALIGN_END;
/**
* @}
- */
+ */
/** @defgroup USBD_DESC_Private_FunctionPrototypes
* @{
- */
+ */
/**
* @}
- */
+ */
/** @defgroup USBD_DESC_Private_Functions
* @{
- */
+ */
/**
-* @brief USBD_FS_DeviceDescriptor
+* @brief USBD_FS_DeviceDescriptor
* return the device descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -188,7 +188,7 @@ uint8_t * USBD_FS_DeviceDescriptor( USBD_SpeedTypeDef speed , uint16_t *length)
}
/**
-* @brief USBD_FS_LangIDStrDescriptor
+* @brief USBD_FS_LangIDStrDescriptor
* return the LangID string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -196,12 +196,12 @@ uint8_t * USBD_FS_DeviceDescriptor( USBD_SpeedTypeDef speed , uint16_t *length)
*/
uint8_t * USBD_FS_LangIDStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length)
{
- *length = sizeof(USBD_LangIDDesc);
+ *length = sizeof(USBD_LangIDDesc);
return USBD_LangIDDesc;
}
/**
-* @brief USBD_FS_ProductStrDescriptor
+* @brief USBD_FS_ProductStrDescriptor
* return the product string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -210,18 +210,18 @@ uint8_t * USBD_FS_LangIDStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *leng
uint8_t * USBD_FS_ProductStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length)
{
if(speed == 0)
- {
+ {
USBD_GetString (USBD_PRODUCT_STRING_FS, USBD_StrDesc, length);
}
else
{
- USBD_GetString (USBD_PRODUCT_STRING_FS, USBD_StrDesc, length);
+ USBD_GetString (USBD_PRODUCT_STRING_FS, USBD_StrDesc, length);
}
return USBD_StrDesc;
}
/**
-* @brief USBD_FS_ManufacturerStrDescriptor
+* @brief USBD_FS_ManufacturerStrDescriptor
* return the manufacturer string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -234,7 +234,7 @@ uint8_t * USBD_FS_ManufacturerStrDescriptor( USBD_SpeedTypeDef speed , uint16_t
}
/**
-* @brief USBD_FS_SerialStrDescriptor
+* @brief USBD_FS_SerialStrDescriptor
* return the serial number string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -243,18 +243,18 @@ uint8_t * USBD_FS_ManufacturerStrDescriptor( USBD_SpeedTypeDef speed , uint16_t
uint8_t * USBD_FS_SerialStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length)
{
if(speed == USBD_SPEED_HIGH)
- {
+ {
USBD_GetString (USBD_SERIALNUMBER_STRING_FS, USBD_StrDesc, length);
}
else
{
- USBD_GetString (USBD_SERIALNUMBER_STRING_FS, USBD_StrDesc, length);
+ USBD_GetString (USBD_SERIALNUMBER_STRING_FS, USBD_StrDesc, length);
}
return USBD_StrDesc;
}
/**
-* @brief USBD_FS_ConfigStrDescriptor
+* @brief USBD_FS_ConfigStrDescriptor
* return the configuration string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -263,18 +263,18 @@ uint8_t * USBD_FS_SerialStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *leng
uint8_t * USBD_FS_ConfigStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *length)
{
if(speed == USBD_SPEED_HIGH)
- {
+ {
USBD_GetString (USBD_CONFIGURATION_STRING_FS, USBD_StrDesc, length);
}
else
{
- USBD_GetString (USBD_CONFIGURATION_STRING_FS, USBD_StrDesc, length);
+ USBD_GetString (USBD_CONFIGURATION_STRING_FS, USBD_StrDesc, length);
}
- return USBD_StrDesc;
+ return USBD_StrDesc;
}
/**
-* @brief USBD_HS_InterfaceStrDescriptor
+* @brief USBD_HS_InterfaceStrDescriptor
* return the interface string descriptor
* @param speed : current device speed
* @param length : pointer to data length variable
@@ -290,18 +290,18 @@ uint8_t * USBD_FS_InterfaceStrDescriptor( USBD_SpeedTypeDef speed , uint16_t *l
{
USBD_GetString (USBD_INTERFACE_STRING_FS, USBD_StrDesc, length);
}
- return USBD_StrDesc;
+ return USBD_StrDesc;
}
/**
* @}
- */
+ */
/**
* @}
- */
+ */
/**
* @}
- */
+ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/