Index: trunk/fw_g473rct/USBPD/App/usbpd_dpm_core.c
===================================================================
--- trunk/fw_g473rct/USBPD/App/usbpd_dpm_core.c	(revision 59)
+++ trunk/fw_g473rct/USBPD/App/usbpd_dpm_core.c	(revision 65)
@@ -96,5 +96,5 @@
   static const USBPD_PE_Callbacks dpmCallbacks =
   {
-    NULL,
+    USBPD_DPM_SetupNewPower,
     USBPD_DPM_HardReset,
     NULL,
@@ -103,6 +103,6 @@
     USBPD_DPM_GetDataInfo,
     USBPD_DPM_SetDataInfo,
+    USBPD_DPM_EvaluateRequest,
     NULL,
-    USBPD_DPM_SNK_EvaluateCapabilities,
     NULL,
     USBPD_PE_TaskWakeUp,
@@ -244,5 +244,5 @@
   UTIL_TIMER_Stop(&TimerPE0);
   uint32_t _timing =
-    USBPD_PE_StateMachine_SNK(USBPD_PORT_0);
+    USBPD_PE_StateMachine_SRC(USBPD_PORT_0);
   if (_timing != 0xFFFFFFFF)
   {
@@ -260,5 +260,5 @@
   UTIL_TIMER_Stop(&TimerPE1);
   uint32_t _timing =
-    USBPD_PE_StateMachine_SNK(USBPD_PORT_1);
+    USBPD_PE_StateMachine_SRC(USBPD_PORT_1);
   if (_timing != 0xFFFFFFFF)
   {
@@ -320,5 +320,5 @@
       {
         DPM_Sleep_time[port] =
-          USBPD_PE_StateMachine_SNK(port);
+          USBPD_PE_StateMachine_SRC(port);
         DPM_Sleep_start[port] = HAL_GetTick();
       }
@@ -327,5 +327,5 @@
     USBPD_DPM_UserExecute(NULL);
 
-  } while (1u == 1u);
+  } while (1u != 1u);
 #endif /* USE_STM32_UTILITY_OS */
 }
Index: trunk/fw_g473rct/USBPD/App/usbpd_pdo_defs.h
===================================================================
--- trunk/fw_g473rct/USBPD/App/usbpd_pdo_defs.h	(revision 59)
+++ trunk/fw_g473rct/USBPD/App/usbpd_pdo_defs.h	(revision 65)
@@ -34,6 +34,6 @@
 
 /* Define   ------------------------------------------------------------------*/
-#define PORT0_NB_SOURCEPDO         0U   /* Number of Source PDOs (applicable for port 0)   */
-#define PORT0_NB_SINKPDO           1U   /* Number of Sink PDOs (applicable for port 0)     */
+#define PORT0_NB_SOURCEPDO         1U   /* Number of Source PDOs (applicable for port 0)   */
+#define PORT0_NB_SINKPDO           0U   /* Number of Sink PDOs (applicable for port 0)     */
 #define PORT1_NB_SOURCEPDO         0U   /* Number of Source PDOs (applicable for port 1)   */
 #define PORT1_NB_SINKPDO           0U   /* Number of Sink PDOs (applicable for port 1)     */
@@ -85,5 +85,20 @@
 uint32_t PORT0_PDO_ListSRC[USBPD_MAX_NB_PDO] =
 {
-  /* PDO 1 */ (0x00000000U),
+  /* PDO 1 */
+  (
+    USBPD_PDO_TYPE_FIXED                 | /* Fixed supply PDO            */
+
+    USBPD_PDO_SRC_FIXED_SET_VOLTAGE(5000U)         | /* Voltage in mV               */
+    USBPD_PDO_SRC_FIXED_SET_MAX_CURRENT(3000U)     | /* Max current in mA           */
+    USBPD_PDO_SRC_FIXED_PEAKCURRENT_EQUAL          | /* Peak Current info           */
+
+    /* Common definitions applicable to all PDOs, defined only in PDO 1 */
+    USBPD_PDO_SRC_FIXED_UNCHUNK_NOT_SUPPORTED      | /* Unchunked Extended Messages */
+    USBPD_PDO_SRC_FIXED_DRD_SUPPORTED          | /* Dual-Role Data              */
+    USBPD_PDO_SRC_FIXED_USBCOMM_SUPPORTED      | /* USB Communications          */
+    USBPD_PDO_SRC_FIXED_EXT_POWER_NOT_AVAILABLE    | /* External Power              */
+    USBPD_PDO_SRC_FIXED_USBSUSPEND_NOT_SUPPORTED   | /* USB Suspend Supported		 */
+    USBPD_PDO_SRC_FIXED_DRP_NOT_SUPPORTED            /* Dual-Role Power             */
+  ),
 
   /* PDO 2 */ (0x00000000U),
@@ -105,19 +120,5 @@
 {
 
-  /* PDO 1 */
-  (
-    USBPD_PDO_TYPE_FIXED                 | /* Fixed supply PDO            */
-
-    USBPD_PDO_SNK_FIXED_SET_VOLTAGE(5000U)         | /* Voltage in mV               */
-    USBPD_PDO_SNK_FIXED_SET_OP_CURRENT(500U)     | /* Operating current in  mA            */
-
-    /* Common definitions applicable to all PDOs, defined only in PDO 1 */
-    USBPD_PDO_SNK_FIXED_FRS_NOT_SUPPORTED          | /* Fast Role Swap				 */
-    USBPD_PDO_SNK_FIXED_DRD_NOT_SUPPORTED          | /* Dual-Role Data              */
-    USBPD_PDO_SNK_FIXED_USBCOMM_NOT_SUPPORTED      | /* USB Communications          */
-    USBPD_PDO_SNK_FIXED_EXT_POWER_NOT_AVAILABLE    | /* External Power              */
-    USBPD_PDO_SNK_FIXED_HIGHERCAPAB_NOT_SUPPORTED   | /* Higher Capability           */
-    USBPD_PDO_SNK_FIXED_DRP_NOT_SUPPORTED            /* Dual-Role Power             */
-  ),
+  /* PDO 1 */ (0x00000000U),
 
   /* PDO 2 */ (0x00000000U),
Index: trunk/fw_g473rct/USBPD/App/usbpd_pwr_if.c
===================================================================
--- trunk/fw_g473rct/USBPD/App/usbpd_pwr_if.c	(revision 59)
+++ trunk/fw_g473rct/USBPD/App/usbpd_pwr_if.c	(revision 65)
@@ -121,4 +121,23 @@
 
 /**
+  * @brief  Sets the required power profile, now it works only with Fixed ones
+  * @param  PortNum Port number
+  * @retval USBPD status
+*/
+USBPD_StatusTypeDef USBPD_PWR_IF_SetProfile(uint8_t PortNum)
+{
+/* USER CODE BEGIN USBPD_PWR_IF_SetProfile */
+  USBPD_StatusTypeDef      _status = USBPD_ERROR;
+  PWR_IF_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_PWR_IF_SetProfile");
+  if (BSP_ERROR_NONE == BSP_USBPD_PWR_VBUSSetVoltage_Fixed(PortNum, 5000, 3000, 3000))
+  {
+     _status = USBPD_OK;
+  }
+ 
+  return _status;
+/* USER CODE END USBPD_PWR_IF_SetProfile */
+}
+
+/**
   * @brief  Checks if the power on a specified port is ready
   * @param  PortNum Port number
@@ -152,4 +171,41 @@
   return status;
 /* USER CODE END USBPD_PWR_IF_SupplyReady */
+}
+
+/**
+  * @brief  Enables VBUS power on a specified port
+  * @param  PortNum Port number
+  * @retval USBPD status
+  */
+USBPD_StatusTypeDef USBPD_PWR_IF_VBUSEnable(uint8_t PortNum)
+{
+/* USER CODE BEGIN USBPD_PWR_IF_VBUSEnable */
+  USBPD_StatusTypeDef _status = (USBPD_StatusTypeDef)HW_IF_PWR_Enable(PortNum, USBPD_ENABLE, CCNONE, USBPD_FALSE, USBPD_PORTPOWERROLE_SRC);
+  return _status;
+/* USER CODE END USBPD_PWR_IF_VBUSEnable */
+}
+
+/**
+  * @brief  Disable VBUS/VCONN the power on a specified port
+  * @param  PortNum Port number
+  * @retval USBPD status
+  */
+USBPD_StatusTypeDef USBPD_PWR_IF_VBUSDisable(uint8_t PortNum)
+{
+/* USER CODE BEGIN USBPD_PWR_IF_VBUSDisable */
+  USBPD_StatusTypeDef _status = (USBPD_StatusTypeDef)HW_IF_PWR_Enable(PortNum, USBPD_DISABLE, CCNONE, USBPD_FALSE, USBPD_PORTPOWERROLE_SRC);
+  return _status;
+/* USER CODE END USBPD_PWR_IF_VBUSDisable */
+}
+
+/**
+  * @brief  Checks if the power on a specified port is enabled
+  * @param  PortNum Port number
+  * @retval USBPD_ENABLE or USBPD_DISABLE
+  */
+USBPD_FunctionalState USBPD_PWR_IF_VBUSIsEnabled(uint8_t PortNum)
+{
+  /* Get the Status of the port */
+  return USBPD_PORT_IsValid(PortNum) ? (USBPD_FunctionalState)HW_IF_PWR_VBUSIsEnabled(PortNum) : USBPD_DISABLE;
 }
 
@@ -207,7 +263,8 @@
 void USBPD_PWR_IF_GetPortPDOs(uint8_t PortNum, USBPD_CORE_DataInfoType_TypeDef DataId, uint8_t *Ptr, uint32_t *Size)
 {
+    if (DataId == USBPD_CORE_DATATYPE_SRC_PDO)
     {
-      *Size = PORT0_NB_SINKPDO;
-      memcpy(Ptr,PORT0_PDO_ListSNK, sizeof(uint32_t) * PORT0_NB_SINKPDO);
+      *Size = PORT0_NB_SOURCEPDO;
+      memcpy(Ptr,PORT0_PDO_ListSRC, sizeof(uint32_t) * PORT0_NB_SOURCEPDO);
     }
 /* USER CODE BEGIN USBPD_PWR_IF_GetPortPDOs */
@@ -269,15 +326,21 @@
   switch(PowerTypeStatus)
   {
-  case USBPD_PWR_BELOWVSAFE0V :
-    if (_vbus < USBPD_PWR_LOW_VBUS_THRESHOLD) _status = USBPD_TRUE;
-    break;
-  case USBPD_PWR_VSAFE5V :
-    if (_vbus >= USBPD_PWR_HIGH_VBUS_THRESHOLD) _status = USBPD_TRUE;
-    break;
-  case USBPD_PWR_SNKDETACH:
-    if (_vbus < USBPD_PWR_HIGH_VBUS_THRESHOLD) _status = USBPD_TRUE;
-    break;
-  default :
-    break;
+	  case USBPD_PWR_BELOWVSAFE0V :
+		  // Here we must make sure that voltage on Vbus is lower than 750mV,
+		  // but we do not monitor Vbus with ADC, so we just assume that voltage is Ok
+		  _status = USBPD_TRUE;
+		  break;
+	  case USBPD_PWR_VSAFE5V :
+		  // Here we must make sure that voltage on Vbus is higher than 2.8V,
+		  // but we do not monitor Vbus with ADC, so we just assume that voltage is Ok
+		  _status = USBPD_TRUE;
+		  break;
+	  case USBPD_PWR_SNKDETACH:
+		  // Here we must make sure that voltage on Vbus is lower than 2.8V,
+		  // but we do not monitor Vbus with ADC, so we just assume that voltage is Ok
+		  _status = USBPD_TRUE;
+		  break;
+	  default :
+		  break;
   }
   return _status;
Index: trunk/fw_g473rct/USBPD/App/usbpd_pwr_if.h
===================================================================
--- trunk/fw_g473rct/USBPD/App/usbpd_pwr_if.h	(revision 59)
+++ trunk/fw_g473rct/USBPD/App/usbpd_pwr_if.h	(revision 65)
@@ -217,4 +217,11 @@
 
 /**
+  * @brief  Sets the required power profile
+  * @param  PortNum Port number
+  * @retval USBPD status
+  */
+USBPD_StatusTypeDef USBPD_PWR_IF_SetProfile(uint8_t PortNum);
+
+/**
   * @brief  Checks if the power on a specified port is ready
   * @param  PortNum Port number
@@ -223,4 +230,25 @@
   */
 USBPD_StatusTypeDef USBPD_PWR_IF_SupplyReady(uint8_t PortNum, USBPD_VSAFE_StatusTypeDef Vsafe);
+
+/**
+  * @brief  Enable VBUS power on a specified port
+  * @param  PortNum Port number
+  * @retval USBPD status
+  */
+USBPD_StatusTypeDef USBPD_PWR_IF_VBUSEnable(uint8_t PortNum);
+
+/**
+  * @brief  Disable VBUS power on a specified port
+  * @param  PortNum Port number
+  * @retval USBPD status
+  */
+USBPD_StatusTypeDef USBPD_PWR_IF_VBUSDisable(uint8_t PortNum);
+
+/**
+  * @brief  Checks if the power on a specified port is enabled
+  * @param  PortNum Port number
+  * @retval ENABLE or DISABLE
+  */
+USBPD_FunctionalState USBPD_PWR_IF_VBUSIsEnabled(uint8_t PortNum);
 
 /**
