source: trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.h@ 67

Last change on this file since 67 was 65, checked in by f.jahn, 5 weeks ago
  • USB-PD function was implemented;
  • HW parity check on RAM was activated;
  • USB Device CDC mode was activated.
File size: 8.3 KB
Line 
1/* USER CODE BEGIN Header */
2/**
3 ******************************************************************************
4 * @file usbpd_dpm_user.h
5 * @author MCD Application Team
6 * @brief Header file for usbpd_dpm_user.c 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_USER_H_
22#define __USBPD_DPM_USER_H_
23
24#ifdef __cplusplus
25 extern "C" {
26#endif
27
28/* Includes ------------------------------------------------------------------*/
29/* USER CODE BEGIN Include */
30
31/* USER CODE END Include */
32
33/** @addtogroup STM32_USBPD_APPLICATION
34 * @{
35 */
36
37/** @addtogroup STM32_USBPD_APPLICATION_DPM_USER
38 * @{
39 */
40
41/* Exported typedef ----------------------------------------------------------*/
42typedef struct
43{
44 uint32_t PE_DataSwap : 1U; /*!< support data swap */
45 uint32_t PE_VconnSwap : 1U; /*!< support VCONN swap */
46 uint32_t PE_DR_Swap_To_DFP : 1U; /*!< If supported, DR Swap to DFP can be accepted or not by the user else directly rejected */
47 uint32_t PE_DR_Swap_To_UFP : 1U; /*!< If supported, DR Swap to UFP can be accepted or not by the user else directly rejected */
48 uint32_t Reserved1 :28U; /*!< Reserved bits */
49 uint32_t Reserved_ReqPower[6]; /*!< Reserved bits to match with Resquested power information */
50 USBPD_MIDB_TypeDef DPM_ManuInfoPort; /*!< Manufacturer information used for the port */
51uint32_t ReservedSnkCapa[6]; /*!< Reserved bits to match with SnkCapaExt information */
52 uint16_t ReservedManu; /*!< Reserved bits to match with Manufacturer information */
53} USBPD_USER_SettingsTypeDef;
54
55typedef struct
56{
57 uint32_t XID; /*!< Value provided by the USB-IF assigned to the product */
58 uint16_t VID; /*!< Vendor ID (assigned by the USB-IF) */
59 uint16_t PID; /*!< Product ID (assigned by the manufacturer) */
60} USBPD_IdSettingsTypeDef;
61/* USER CODE BEGIN Typedef */
62
63/* USER CODE END Typedef */
64
65/* Exported define -----------------------------------------------------------*/
66/* USER CODE BEGIN Define */
67
68/* USER CODE END Define */
69
70/* Exported constants --------------------------------------------------------*/
71/* USER CODE BEGIN Constant */
72
73/* USER CODE END Constant */
74
75/* Exported macro ------------------------------------------------------------*/
76/* USER CODE BEGIN Macro */
77
78/* USER CODE END Macro */
79
80/* Exported variables --------------------------------------------------------*/
81/* USER CODE BEGIN Private_Variables */
82
83/* USER CODE END Private_Variables */
84
85/* Exported functions --------------------------------------------------------*/
86/** @addtogroup USBPD_USER_EXPORTED_FUNCTIONS
87 * @{
88 */
89/** @addtogroup USBPD_USER_EXPORTED_FUNCTIONS_GROUP1
90 * @{
91 */
92USBPD_StatusTypeDef USBPD_DPM_UserInit(void);
93void USBPD_DPM_WaitForTime(uint32_t Time);
94void USBPD_DPM_UserExecute(void const *argument);
95void USBPD_DPM_UserCableDetection(uint8_t PortNum, USBPD_CAD_EVENT State);
96void USBPD_DPM_UserTimerCounter(uint8_t PortNum);
97
98/**
99 * @}
100 */
101
102/** @addtogroup USBPD_USER_EXPORTED_FUNCTIONS_GROUP2
103 * @{
104 */
105void USBPD_DPM_Notification(uint8_t PortNum, USBPD_NotifyEventValue_TypeDef EventVal);
106USBPD_StatusTypeDef USBPD_DPM_SetupNewPower(uint8_t PortNum);
107void USBPD_DPM_HardReset(uint8_t PortNum, USBPD_PortPowerRole_TypeDef CurrentRole, USBPD_HR_Status_TypeDef Status);
108void USBPD_DPM_ExtendedMessageReceived(uint8_t PortNum, USBPD_ExtendedMsg_TypeDef MsgType, uint8_t *ptrData, uint16_t DataSize);
109void USBPD_DPM_GetDataInfo(uint8_t PortNum, USBPD_CORE_DataInfoType_TypeDef DataId , uint8_t *Ptr, uint32_t *Size);
110void USBPD_DPM_SetDataInfo(uint8_t PortNum, USBPD_CORE_DataInfoType_TypeDef DataId , uint8_t *Ptr, uint32_t Size);
111USBPD_StatusTypeDef USBPD_DPM_EvaluateRequest(uint8_t PortNum, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObject);
112USBPD_StatusTypeDef USBPD_DPM_EvaluateVconnSwap(uint8_t PortNum);
113USBPD_StatusTypeDef USBPD_DPM_PE_VconnPwr(uint8_t PortNum, USBPD_FunctionalState State);
114void USBPD_DPM_EnterErrorRecovery(uint8_t PortNum);
115USBPD_StatusTypeDef USBPD_DPM_EvaluateDataRoleSwap(uint8_t PortNum);
116USBPD_FunctionalState USBPD_DPM_IsPowerReady(uint8_t PortNum, USBPD_VSAFE_StatusTypeDef Vsafe);
117
118/**
119 * @}
120 */
121
122/** @addtogroup USBPD_USER_EXPORTED_FUNCTIONS_GROUP3
123 * @{
124 */
125USBPD_StatusTypeDef USBPD_DPM_RequestHardReset(uint8_t PortNum);
126USBPD_StatusTypeDef USBPD_DPM_RequestCableReset(uint8_t PortNum);
127USBPD_StatusTypeDef USBPD_DPM_RequestGotoMin(uint8_t PortNum);
128USBPD_StatusTypeDef USBPD_DPM_RequestPing(uint8_t PortNum);
129USBPD_StatusTypeDef USBPD_DPM_RequestMessageRequest(uint8_t PortNum, uint8_t IndexSrcPDO, uint16_t RequestedVoltage);
130USBPD_StatusTypeDef USBPD_DPM_RequestGetSourceCapability(uint8_t PortNum);
131USBPD_StatusTypeDef USBPD_DPM_RequestGetSinkCapability(uint8_t PortNum);
132USBPD_StatusTypeDef USBPD_DPM_RequestDataRoleSwap(uint8_t PortNum);
133USBPD_StatusTypeDef USBPD_DPM_RequestPowerRoleSwap(uint8_t PortNum);
134USBPD_StatusTypeDef USBPD_DPM_RequestVconnSwap(uint8_t PortNum);
135USBPD_StatusTypeDef USBPD_DPM_RequestSoftReset(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType);
136USBPD_StatusTypeDef USBPD_DPM_RequestSourceCapability(uint8_t PortNum);
137USBPD_StatusTypeDef USBPD_DPM_RequestVDM_DiscoveryIdentify(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType);
138USBPD_StatusTypeDef USBPD_DPM_RequestVDM_DiscoverySVID(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType);
139USBPD_StatusTypeDef USBPD_DPM_RequestVDM_DiscoveryMode(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint16_t SVID);
140USBPD_StatusTypeDef USBPD_DPM_RequestVDM_EnterMode(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint16_t SVID, uint8_t ModeIndex);
141USBPD_StatusTypeDef USBPD_DPM_RequestVDM_ExitMode(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint16_t SVID, uint8_t ModeIndex);
142USBPD_StatusTypeDef USBPD_DPM_RequestDisplayPortStatus(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint16_t SVID, uint32_t *pDPStatus);
143USBPD_StatusTypeDef USBPD_DPM_RequestDisplayPortConfig(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint16_t SVID, uint32_t *pDPConfig);
144USBPD_StatusTypeDef USBPD_DPM_RequestAttention(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint16_t SVID);
145USBPD_StatusTypeDef USBPD_DPM_RequestAlert(uint8_t PortNum, USBPD_ADO_TypeDef Alert);
146USBPD_StatusTypeDef USBPD_DPM_RequestGetSourceCapabilityExt(uint8_t PortNum);
147USBPD_StatusTypeDef USBPD_DPM_RequestGetSinkCapabilityExt(uint8_t PortNum);
148USBPD_StatusTypeDef USBPD_DPM_RequestGetManufacturerInfo(uint8_t PortNum, USBPD_SOPType_TypeDef SOPType, uint8_t* pManuInfoData);
149USBPD_StatusTypeDef USBPD_DPM_RequestGetStatus(uint8_t PortNum);
150USBPD_StatusTypeDef USBPD_DPM_RequestFastRoleSwap(uint8_t PortNum);
151USBPD_StatusTypeDef USBPD_DPM_RequestGetPPS_Status(uint8_t PortNum);
152USBPD_StatusTypeDef USBPD_DPM_RequestGetCountryCodes(uint8_t PortNum);
153USBPD_StatusTypeDef USBPD_DPM_RequestGetCountryInfo(uint8_t PortNum, uint16_t CountryCode);
154USBPD_StatusTypeDef USBPD_DPM_RequestGetBatteryCapability(uint8_t PortNum, uint8_t *pBatteryCapRef);
155USBPD_StatusTypeDef USBPD_DPM_RequestGetBatteryStatus(uint8_t PortNum, uint8_t *pBatteryStatusRef);
156USBPD_StatusTypeDef USBPD_DPM_RequestSecurityRequest(uint8_t PortNum);
157/* USER CODE BEGIN Function */
158
159/* USER CODE END Function */
160/**
161 * @}
162 */
163
164/**
165 * @}
166 */
167
168/**
169 * @}
170 */
171
172/**
173 * @}
174 */
175
176#ifdef __cplusplus
177}
178#endif
179
180#endif /* __USBPD_DPM_USER_H_ */
Note: See TracBrowser for help on using the repository browser.