| 1 | /* USER CODE BEGIN Header */
|
|---|
| 2 | /**
|
|---|
| 3 | ******************************************************************************
|
|---|
| 4 | * @file usbpd_dpm_conf.h
|
|---|
| 5 | * @author MCD Application Team
|
|---|
| 6 | * @brief Header file for stack/application settings file
|
|---|
| 7 | ******************************************************************************
|
|---|
| 8 | * @attention
|
|---|
| 9 | *
|
|---|
| 10 | * Copyright (c) 2026 STMicroelectronics.
|
|---|
| 11 | * All rights reserved.
|
|---|
| 12 | *
|
|---|
| 13 | * This software is licensed under terms that can be found in the LICENSE file
|
|---|
| 14 | * in the root directory of this software component.
|
|---|
| 15 | * If no LICENSE file comes with this software, it is provided AS-IS.
|
|---|
| 16 | *
|
|---|
| 17 | ******************************************************************************
|
|---|
| 18 | */
|
|---|
| 19 | /* USER CODE END Header */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef __USBPD_DPM_CONF_H_
|
|---|
| 22 | #define __USBPD_DPM_CONF_H_
|
|---|
| 23 |
|
|---|
| 24 | #ifdef __cplusplus
|
|---|
| 25 | extern "C" {
|
|---|
| 26 | #endif
|
|---|
| 27 |
|
|---|
| 28 | /* Includes ------------------------------------------------------------------*/
|
|---|
| 29 | #include "usbpd_pdo_defs.h"
|
|---|
| 30 | #include "usbpd_dpm_user.h"
|
|---|
| 31 | #include "usbpd_vdm_user.h"
|
|---|
| 32 |
|
|---|
| 33 | /* USER CODE BEGIN Includes */
|
|---|
| 34 | /* Section where include file can be added */
|
|---|
| 35 |
|
|---|
| 36 | /* USER CODE END Includes */
|
|---|
| 37 |
|
|---|
| 38 | /* Define ------------------------------------------------------------------*/
|
|---|
| 39 | /* Define VID, PID,... manufacturer parameters */
|
|---|
| 40 | #define USBPD_VID (0x0483u) /*!< Vendor ID (assigned by the USB-IF) */
|
|---|
| 41 | #define USBPD_PID (0x0002u) /*!< Product ID (assigned by the manufacturer) */
|
|---|
| 42 | #define USBPD_XID (0xF0000003u) /*!< Value provided by the USB-IF assigned to the product */
|
|---|
| 43 |
|
|---|
| 44 | /* USER CODE BEGIN Define */
|
|---|
| 45 | /* Section where Define can be added */
|
|---|
| 46 |
|
|---|
| 47 | /* USER CODE END Define */
|
|---|
| 48 |
|
|---|
| 49 | /* Exported typedef ----------------------------------------------------------*/
|
|---|
| 50 | /* USER CODE BEGIN Typedef */
|
|---|
| 51 | /* Section where Typedef can be added */
|
|---|
| 52 |
|
|---|
| 53 | /* USER CODE END Typedef */
|
|---|
| 54 |
|
|---|
| 55 | /* Private variables ---------------------------------------------------------*/
|
|---|
| 56 | #ifndef __USBPD_DPM_CORE_C
|
|---|
| 57 | extern USBPD_SettingsTypeDef DPM_Settings[USBPD_PORT_COUNT];
|
|---|
| 58 | extern USBPD_IdSettingsTypeDef DPM_ID_Settings[USBPD_PORT_COUNT];
|
|---|
| 59 | extern USBPD_USER_SettingsTypeDef DPM_USER_Settings[USBPD_PORT_COUNT];
|
|---|
| 60 | #else /* __USBPD_DPM_CORE_C */
|
|---|
| 61 | USBPD_SettingsTypeDef DPM_Settings[USBPD_PORT_COUNT] =
|
|---|
| 62 | {
|
|---|
| 63 | {
|
|---|
| 64 | .PE_SupportedSOP = USBPD_SUPPORTED_SOP_SOP , /* Supported SOP : SOP, SOP' SOP" SOP'Debug SOP"Debug */
|
|---|
| 65 | .PE_SpecRevision = USBPD_SPECIFICATION_REV3,/* spec revision value */
|
|---|
| 66 | .PE_DefaultRole = USBPD_PORTPOWERROLE_SRC, /* Default port role */
|
|---|
| 67 | .PE_RoleSwap = USBPD_FALSE, /* support port role swap */
|
|---|
| 68 | .PE_VDMSupport = USBPD_FALSE,
|
|---|
| 69 | .PE_RespondsToDiscovSOP = USBPD_FALSE, /*!< Can respond successfully to a Discover Identity */
|
|---|
| 70 | .PE_AttemptsDiscovSOP = USBPD_FALSE, /*!< Can send a Discover Identity */
|
|---|
| 71 | .PE_PingSupport = USBPD_FALSE, /* support Ping (only for PD3.0) */
|
|---|
| 72 | .PE_CapscounterSupport = USBPD_FALSE, /* support caps counter */
|
|---|
| 73 | .CAD_RoleToggle = USBPD_FALSE, /* CAD role toggle */
|
|---|
| 74 | .CAD_DefaultResistor = 0x02u,
|
|---|
| 75 | .CAD_TryFeature = 0, /* CAD try feature */
|
|---|
| 76 | .CAD_AccesorySupport = USBPD_FALSE, /* CAD accessory support */
|
|---|
| 77 | .PE_PD3_Support.d = /*!< PD3 SUPPORT FEATURE */
|
|---|
| 78 | {
|
|---|
| 79 | .PE_UnchunkSupport = USBPD_FALSE, /* support Unchunked mode (valid only spec revision 3.0) */
|
|---|
| 80 | .PE_FastRoleSwapSupport = USBPD_FALSE, /* support fast role swap only spec revision 3.0 */
|
|---|
| 81 | .Is_GetPPSStatus_Supported = USBPD_FALSE, /*!< PPS message NOT supported by PE stack */
|
|---|
| 82 | .Is_SrcCapaExt_Supported = USBPD_FALSE, /*!< Source_Capabilities_Extended message supported or not by DPM */
|
|---|
| 83 | .Is_Alert_Supported = USBPD_FALSE, /*!< Alert message supported or not by DPM */
|
|---|
| 84 | .Is_GetStatus_Supported = USBPD_FALSE, /*!< Status message supported or not by DPM (Is_Alert_Supported should be enabled) */
|
|---|
| 85 | .Is_GetManufacturerInfo_Supported = USBPD_FALSE, /*!< Manufacturer_Info message supported or not by DPM */
|
|---|
| 86 | .Is_GetCountryCodes_Supported = USBPD_FALSE, /*!< Country_Codes message supported or not by DPM */
|
|---|
| 87 | .Is_GetCountryInfo_Supported = USBPD_FALSE, /*!< Country_Info message supported or not by DPM */
|
|---|
| 88 | .Is_SecurityRequest_Supported = USBPD_FALSE, /*!< Security_Response message supported or not by DPM */
|
|---|
| 89 | .Is_FirmUpdateRequest_Supported = USBPD_FALSE, /*!< Firmware update response message supported by PE */
|
|---|
| 90 | .Is_GetBattery_Supported = USBPD_FALSE, /*!< Get Battery Capabitity and Status messages supported by PE */
|
|---|
| 91 | },
|
|---|
| 92 |
|
|---|
| 93 | .CAD_SRCToggleTime = 0, /* uint8_t CAD_SRCToggleTime; */
|
|---|
| 94 | .CAD_SNKToggleTime = 0, /* uint8_t CAD_SNKToggleTime; */
|
|---|
| 95 | }
|
|---|
| 96 | };
|
|---|
| 97 |
|
|---|
| 98 | USBPD_IdSettingsTypeDef DPM_ID_Settings[USBPD_PORT_COUNT] =
|
|---|
| 99 | {
|
|---|
| 100 | {
|
|---|
| 101 | .XID = USBPD_XID, /*!< Value provided by the USB-IF assigned to the product */
|
|---|
| 102 | .VID = USBPD_VID, /*!< Vendor ID (assigned by the USB-IF) */
|
|---|
| 103 | .PID = USBPD_PID, /*!< Product ID (assigned by the manufacturer) */
|
|---|
| 104 | },
|
|---|
| 105 | };
|
|---|
| 106 |
|
|---|
| 107 | USBPD_USER_SettingsTypeDef DPM_USER_Settings[USBPD_PORT_COUNT] =
|
|---|
| 108 | {
|
|---|
| 109 | {
|
|---|
| 110 | .PE_DataSwap = USBPD_TRUE, /* support data swap */
|
|---|
| 111 | .PE_VconnSwap = USBPD_FALSE, /* support VCONN swap */
|
|---|
| 112 | .PE_DR_Swap_To_DFP = USBPD_TRUE, /* Support of DR Swap to DFP */
|
|---|
| 113 | .PE_DR_Swap_To_UFP = USBPD_TRUE, /* Support of DR Swap to UFP */
|
|---|
| 114 | #if defined(USBPD_REV30_SUPPORT)
|
|---|
| 115 | #if _MANU_INFO
|
|---|
| 116 | .DPM_ManuInfoPort = /*!< Manufacturer information used for the port */
|
|---|
| 117 | {
|
|---|
| 118 | .VID = USBPD_VID, /*!< Vendor ID (assigned by the USB-IF) */
|
|---|
| 119 | .PID = USBPD_PID, /*!< Product ID (assigned by the manufacturer) */
|
|---|
| 120 | .ManuString = "STMicroelectronics", /*!< Vendor defined byte array */
|
|---|
| 121 | },
|
|---|
| 122 | #endif /* _MANU_INFO */
|
|---|
| 123 | #endif /* USBPD_REV30_SUPPORT */
|
|---|
| 124 | },
|
|---|
| 125 | };
|
|---|
| 126 |
|
|---|
| 127 | #endif /* !__USBPD_DPM_CORE_C */
|
|---|
| 128 |
|
|---|
| 129 | /* USER CODE BEGIN Variable */
|
|---|
| 130 | /* Section where Variable can be added */
|
|---|
| 131 |
|
|---|
| 132 | /* USER CODE END Variable */
|
|---|
| 133 |
|
|---|
| 134 | /* Exported constants --------------------------------------------------------*/
|
|---|
| 135 | /* USER CODE BEGIN Constant */
|
|---|
| 136 | /* Section where Constant can be added */
|
|---|
| 137 |
|
|---|
| 138 | /* USER CODE END Constant */
|
|---|
| 139 |
|
|---|
| 140 | /* Exported macro ------------------------------------------------------------*/
|
|---|
| 141 | /* USER CODE BEGIN Macro */
|
|---|
| 142 | /* Section where Macro can be added */
|
|---|
| 143 |
|
|---|
| 144 | /* USER CODE END Macro */
|
|---|
| 145 |
|
|---|
| 146 | #ifdef __cplusplus
|
|---|
| 147 | }
|
|---|
| 148 | #endif
|
|---|
| 149 |
|
|---|
| 150 | #endif /* __USBPD_DPM_CONF_H_ */
|
|---|