Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add composite MSC CDC USB device#586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Bob-the-Kuhn wants to merge20 commits intostm32duino:masterfromBob-the-Kuhn:compositemsc_cdc
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
331bb36
copy MSC CDC composite files
Bob-the-KuhnJul 30, 2019
2178b86
remove unintended changes, partial formatting corrections
Bob-the-KuhnJul 30, 2019
13f1397
more formatting fixes
Bob-the-KuhnJul 31, 2019
b75601e
round 3 of formatting corrections
Bob-the-KuhnJul 31, 2019
2ab53ef
remove test file, more formatting corrections
Bob-the-KuhnJul 31, 2019
3ec56f6
round 5 of formatting corrections
Bob-the-KuhnJul 31, 2019
2b3ef40
round 6
Bob-the-KuhnJul 31, 2019
d2997f0
round 6
Bob-the-KuhnJul 31, 2019
c9519bc
round 8 - down to 1
Bob-the-KuhnJul 31, 2019
41ded9d
copy latest code over
Bob-the-KuhnMar 21, 2020
26202dc
more 'move released code changes into branch"
Bob-the-KuhnMar 21, 2020
6c50490
Merge branch 'master' into compositemsc_cdc
Bob-the-KuhnMar 21, 2020
59ec446
forcing update to usbd_conf.c (github problem?)
Bob-the-KuhnMar 21, 2020
6fc79cb
Merge branch 'compositemsc_cdc' of https://github.com/Bob-the-Kuhn/Ar…
Bob-the-KuhnMar 21, 2020
0916513
copy evrything but USB from current released code intothis PR
Bob-the-KuhnMar 22, 2020
303748a
style & trailing blank corrections
Bob-the-KuhnMar 22, 2020
c4106cc
more formatting fixes
Bob-the-KuhnMar 22, 2020
400b38f
nonsense change to force another round of travis tests
Bob-the-KuhnMar 22, 2020
5b15a1f
remove test code
Bob-the-KuhnMar 22, 2020
5f170d2
bring branch up to current master
Bob-the-KuhnMar 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modifiedCI/utils/gen_wrapper.sh
100755 → 100644
View file
Open in desktop
Empty file.
15 changes: 9 additions & 6 deletionscores/arduino/stm32/usb/cdc/usbd_cdc.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,6 +52,7 @@

#ifdef USBCON
#ifdef USBD_USE_CDC
#ifndef USBD_USE_CDC_COMPOSITE

/* Includes ------------------------------------------------------------------*/
#include "usbd_cdc.h"
Expand DownExpand Up@@ -190,7 +191,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
0x01, /* bNumEndpoints: One endpoints used */
0x02, /* bInterfaceClass: Communication Interface Class */
0x02, /* bInterfaceSubClass: Abstract Control Model */
0x00, /* bInterfaceProtocol:No specific protocol */
0x01, /* bInterfaceProtocol:Common AT commands */
0x00, /* iInterface: */

/*Header Functional Descriptor*/
Expand DownExpand Up@@ -285,7 +286,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
0x01, /* bNumEndpoints: One endpoints used */
0x02, /* bInterfaceClass: Communication Interface Class */
0x02, /* bInterfaceSubClass: Abstract Control Model */
0x00, /* bInterfaceProtocol:No specific protocol */
0x01, /* bInterfaceProtocol:Common AT commands */
0x00, /* iInterface: */

/*Header Functional Descriptor*/
Expand DownExpand Up@@ -375,7 +376,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
0x01, /* bNumEndpoints: One endpoints used */
0x02, /* bInterfaceClass: Communication Interface Class */
0x02, /* bInterfaceSubClass: Abstract Control Model */
0x00, /* bInterfaceProtocol:No specific protocol */
0x01, /* bInterfaceProtocol:Common AT commands */
0x00, /* iInterface: */

/*Header Functional Descriptor*/
Expand DownExpand Up@@ -651,9 +652,9 @@ static uint8_t USBD_CDC_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
USBD_CDC_ItfTypeDef *ctrl = (USBD_CDC_ItfTypeDef *)pdev->pUserData;

if (pdev->pClassData != NULL) {
if ((pdev->ep_in[epnum].total_length > 0U) && ((pdev->ep_in[epnum].total_length % hpcd->IN_ep[epnum].maxpacket) == 0U)) {
if ((hcdc->TxLastLength > 0U) && ((hcdc->TxLastLength % hpcd->IN_ep[epnum].maxpacket) == 0U)) {
/* Update the packet total length */
pdev->ep_in[epnum].total_length = 0U;
hcdc->TxLastLength = 0U;

/* Send ZLP */
USBD_LL_Transmit(pdev, epnum, NULL, 0U);
Expand DownExpand Up@@ -835,7 +836,7 @@ uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev)
hcdc->TxState = 1U;

/* Update the packet total length */
pdev->ep_in[CDC_IN_EP & 0xFU].total_length = hcdc->TxLength;
hcdc->TxLastLength = hcdc->TxLength;

/* Transmit next packet */
USBD_LL_Transmit(pdev, CDC_IN_EP, hcdc->TxBuffer,
Expand DownExpand Up@@ -894,6 +895,8 @@ uint8_t USBD_CDC_ClearBuffer(USBD_HandleTypeDef *pdev)
}
}

#endif /* !USBD_USE_CDC_COMPOSITE */
#endif /* USBD_USE_CDC */
#endif /* USBCON */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

41 changes: 30 additions & 11 deletionscores/arduino/stm32/usb/cdc/usbd_cdc.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,7 @@ extern "C" {

/* Includes ------------------------------------------------------------------*/
#include "usbd_ioreq.h"
#include"usbd_ep_conf.h"
#include<stdint.h>

/** @addtogroup STM32_USB_DEVICE_LIBRARY
* @{
Expand All@@ -38,18 +38,33 @@ extern "C" {
* @{
*/


/** @defgroup usbd_cdc_Exported_Defines
* @{
*/

#ifdef USBD_USE_CDC_COMPOSITE
#define CDC_IN_EP 0x82U /* EP2 for data IN */
#define CDC_OUT_EP 0x02U /* EP2 for data OUT */
#define CDC_CMD_EP 0x83U /* EP3 for CDC commands */
#else
#define CDC_IN_EP 0x82U /* EP1 for data IN */
#define CDC_OUT_EP 0x01U /* EP1 for data OUT */
#define CDC_CMD_EP 0x83U /* EP2 for CDC commands */
#endif

#ifndef CDC_HS_BINTERVAL
#define CDC_HS_BINTERVAL0x10U
#define CDC_HS_BINTERVAL 0x10U
#endif /* CDC_HS_BINTERVAL */

#ifndef CDC_FS_BINTERVAL
#define CDC_FS_BINTERVAL0x10U
#define CDC_FS_BINTERVAL 0x10U
#endif /* CDC_FS_BINTERVAL */

/* CDC Endpoints parameters */
/* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */
#define CDC_DATA_HS_MAX_PACKET_SIZE 512U /* Endpoint IN & OUT Packet size */
#define CDC_DATA_FS_MAX_PACKET_SIZE 64U /* Endpoint IN & OUT Packet size */
#define CDC_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */

#define USB_CDC_CONFIG_DESC_SIZ 67U
#define CDC_DATA_HS_IN_PACKET_SIZE CDC_DATA_HS_MAX_PACKET_SIZE
Expand DownExpand Up@@ -99,20 +114,23 @@ typedef struct _USBD_CDC_Itf {

} USBD_CDC_ItfTypeDef;

#ifndef __IO
#define __IO volatile /*!< \brief Defines 'read / write' permissions */
#endif

typedef struct {
typedef struct_USBD_CDC_HandleTypeDef{
uint32_t data[CDC_DATA_HS_MAX_PACKET_SIZE / 4U]; /* Force 32bits alignment */
uint8_t CmdOpCode;
uint8_t CmdLength;
uint8_t*RxBuffer;
uint8_t*TxBuffer;
uint8_t *RxBuffer;
uint8_t *TxBuffer;
uint32_t RxLength;
uint32_t TxLength;
uint32_t TxLastLength;

__IO uint32_t TxState;
__IO uint32_t RxState;
}
USBD_CDC_HandleTypeDef;
} USBD_CDC_HandleTypeDef;



Expand All@@ -127,8 +145,8 @@ USBD_CDC_HandleTypeDef;
/** @defgroup USBD_CORE_Exported_Variables
* @{
*/

externUSBD_ClassTypeDef USBD_CDC;
struct _Device_cb; // USBD_ClassTypeDef
externstruct _Device_cb USBD_CDC;
#define USBD_CDC_CLASS &USBD_CDC
/**
* @}
Expand DownExpand Up@@ -170,3 +188,4 @@ uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev);
*/

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

2 changes: 2 additions & 0 deletionscores/arduino/stm32/usb/cdc/usbd_cdc_if.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@

#ifdef USBCON
#ifdef USBD_USE_CDC
#ifndef USBD_USE_CDC_COMPOSITE

/* Includes ------------------------------------------------------------------*/
#include "usbd_desc.h"
Expand DownExpand Up@@ -335,6 +336,7 @@ bool CDC_resume_receive(void)
return false;
}

#endif /* !USBD_USE_CDC_COMPOSITE */
#endif /* USBD_USE_CDC */
#endif /* USBCON */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp