Skip to content

Commit

Permalink
usb composite device working with vcp and msc
Browse files Browse the repository at this point in the history
  • Loading branch information
trentgill committed Jun 11, 2024
1 parent 8539ea0 commit 3dfab02
Show file tree
Hide file tree
Showing 16 changed files with 170 additions and 618 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ SRC = main.c \
lib/slopes.c \
lib/midi.c \
lib/mhost.c \
lib/usb_otg.c \
$(wildcard ll/*.c) \
$(USBD_COMPOSITE)/App/usb_device.c \
$(USBD_COMPOSITE)/App/usbd_cdc_acm_if.c \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,73 +1,14 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : usb_device.c
* @version : v1.0_Cube
* @brief : This file implements the USB Device
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/

#include "usb_device.h"
#include "usbd_desc.h"
#include "main.h"
#include "../Target/usbd_conf.h"

/* USER CODE BEGIN Includes */
#include "ll/debug_usart.h"
#include "usbd_composite.h"
/* USER CODE END Includes */

/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/

/* USER CODE END PV */

/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/

/* USER CODE END PFP */

/* USB Device Core handle declaration. */
USBD_HandleTypeDef hUsbDevice;

/*
* -- Insert your variables declaration here --
*/
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */

/*
* -- Insert your external function declaration here --
*/
/* USER CODE BEGIN 1 */

/* USER CODE END 1 */

/**
* Init USB device Library, add supported class and start the library
* @retval None
*/
void MX_USB_DEVICE_Init(void)
{
/* USER CODE BEGIN USB_DEVICE_Init_PreTreatment */

/* USER CODE END USB_DEVICE_Init_PreTreatment */

/* Init Device Library, add supported class and start the library. */
void MX_USB_DEVICE_Init(void){
USBD_COMPOSITE_Mount_Class();

#if (USBD_USE_HS == 1)
Expand Down Expand Up @@ -149,6 +90,8 @@ void MX_USB_DEVICE_Init(void)
Error_Handler();
}
#endif
// printf("usbd_start\n\r");
// U_PrintNow();
if (USBD_Start(&hUsbDevice) != USBD_OK)
{
Error_Handler();
Expand Down
Loading

0 comments on commit 3dfab02

Please sign in to comment.