{stm32,stm32l4,stm32f0l0g0}/otg: move STM32_NENDPOINTS definitions to header files

This value is useful for users when initializing a USB composite device in a board-specific logic
This commit is contained in:
raiden00pl 2023-03-24 12:38:35 +01:00 committed by David Sidrane
parent 2c97c76577
commit 68f6fb2edd
11 changed files with 40 additions and 15 deletions

View File

@ -35,6 +35,14 @@
#if defined(CONFIG_STM32_OTGFS) #if defined(CONFIG_STM32_OTGFS)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Number of endpoints */
#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/

View File

@ -271,10 +271,6 @@
/* Endpoints ****************************************************************/ /* Endpoints ****************************************************************/
/* Number of endpoints */
#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */
/* Odd physical endpoint numbers are IN; even are OUT */ /* Odd physical endpoint numbers are IN; even are OUT */
#define STM32_EPPHYIN2LOG(epphy) ((uint8_t)(epphy)|USB_DIR_IN) #define STM32_EPPHYIN2LOG(epphy) ((uint8_t)(epphy)|USB_DIR_IN)

View File

@ -34,6 +34,14 @@
#if defined(CONFIG_STM32_OTGHS) #if defined(CONFIG_STM32_OTGHS)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Number of endpoints */
#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/

View File

@ -227,10 +227,6 @@
/* Endpoints ****************************************************************/ /* Endpoints ****************************************************************/
/* Number of endpoints */
#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */
/* Odd physical endpoint numbers are IN; even are OUT */ /* Odd physical endpoint numbers are IN; even are OUT */
#define STM32_EPPHYIN2LOG(epphy) ((uint8_t)(epphy)|USB_DIR_IN) #define STM32_EPPHYIN2LOG(epphy) ((uint8_t)(epphy)|USB_DIR_IN)

View File

@ -103,7 +103,6 @@
* endpoint register sets there are. * endpoint register sets there are.
*/ */
#define STM32_NENDPOINTS (8)
#define EP0 (0) #define EP0 (0)
#define EP1 (1) #define EP1 (1)
#define EP2 (2) #define EP2 (2)

View File

@ -32,6 +32,14 @@
#include "chip.h" #include "chip.h"
#include "hardware/stm32_usbdev.h" #include "hardware/stm32_usbdev.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Number of endpoints */
#define STM32_NENDPOINTS (8)
/**************************************************************************** /****************************************************************************
* Public Functions Prototypes * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/

View File

@ -84,7 +84,6 @@
* endpoint register sets there are. * endpoint register sets there are.
*/ */
#define STM32_NENDPOINTS (8)
#define EP0 (0) #define EP0 (0)
#define EP1 (1) #define EP1 (1)
#define EP2 (2) #define EP2 (2)

View File

@ -32,6 +32,14 @@
#include "chip.h" #include "chip.h"
#include "hardware/stm32_usbfs.h" #include "hardware/stm32_usbfs.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Number of endpoints */
#define STM32_NENDPOINTS (8)
/**************************************************************************** /****************************************************************************
* Public Functions Prototypes * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/

View File

@ -89,7 +89,6 @@
* endpoint register sets there are. * endpoint register sets there are.
*/ */
#define STM32_NENDPOINTS (8)
#define EP0 (0) #define EP0 (0)
#define EP1 (1) #define EP1 (1)
#define EP2 (2) #define EP2 (2)

View File

@ -41,6 +41,14 @@
# error "Unsupported STM32L4 chip" # error "Unsupported STM32L4 chip"
#endif #endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Number of endpoints */
#define STM32L4_NENDPOINTS (6) /* ep0-5 x 2 for IN and OUT */
/**************************************************************************** /****************************************************************************
* Public Functions Prototypes * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/

View File

@ -106,10 +106,6 @@
# define CONFIG_USBDEV_EP5_TXFIFO_SIZE 128 # define CONFIG_USBDEV_EP5_TXFIFO_SIZE 128
#endif #endif
/* Number of endpoints */
#define STM32L4_NENDPOINTS (6) /* ep0-5 x 2 for IN and OUT */
/* Adjust actual number of endpoints based upon size; /* Adjust actual number of endpoints based upon size;
* 0 means 'not available', and we expect that the first 0-length endpoint * 0 means 'not available', and we expect that the first 0-length endpoint
* implies that all others after are unused as well (irrespective of what * implies that all others after are unused as well (irrespective of what