2019-10-21 11:53 PM
I found senduvdm callback in usbpd_vdm_user,c "USBPD_VDM_SendUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef *pUVDM_Header, uint8_t *pNbData, uint32_t *pVDO)";
and just found one interface,USBPD_StatusTypeDef USBPD_PE_UVDM_RequestMessage (uint8_t PortNum, USBPD_SOPType_TypeDef SOPType ), which can't set my data,and how to send an uvdm package after call a "send interface" ?
Solved! Go to Solution.
2019-10-22 12:51 AM
Hello
Here is the associated Message Sequence Chart you can refer to:
To fill data, you have to complete the following callbacks functions in usbpd_vdm_user.c file:
/**
* @brief VDM Send Unstructured message callback
* @param PortNum current port number
* @param pUVDM_Header Pointer on UVDM header based on @ref USBPD_UVDMHeader_TypeDef
* @param pNbData Pointer of number of VDO to send
* @param pVDO Pointer of VDO to send
* @retval None
*/
static void USBPD_VDM_SendUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef *pUVDM_Header, uint8_t *pNbData, uint32_t *pVDO)
{
/* USER CODE BEGIN USBPD_VDM_SendUVDM */
/* USER CODE END USBPD_VDM_SendUVDM */
}
/**
* @brief Unstructured VDM message callback to inform user of reception of UVDM message
* @param PortNum current port number
* @param UVDM_Header UVDM header based on @ref USBPD_UVDMHeader_TypeDef
* @param pNbData Pointer of number of received VDO
* @param pVDO Pointer of received VDO
* @retval USBPD Status
*/
static USBPD_StatusTypeDef USBPD_VDM_ReceiveUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef UVDM_Header, uint8_t *pNbData, uint32_t *pVDO)
{
/* USER CODE BEGIN USBPD_VDM_ReceiveUVDM */
return USBPD_ERROR;
/* USER CODE END USBPD_VDM_ReceiveUVDM */
}
2019-10-22 12:51 AM
Hello
Here is the associated Message Sequence Chart you can refer to:
To fill data, you have to complete the following callbacks functions in usbpd_vdm_user.c file:
/**
* @brief VDM Send Unstructured message callback
* @param PortNum current port number
* @param pUVDM_Header Pointer on UVDM header based on @ref USBPD_UVDMHeader_TypeDef
* @param pNbData Pointer of number of VDO to send
* @param pVDO Pointer of VDO to send
* @retval None
*/
static void USBPD_VDM_SendUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef *pUVDM_Header, uint8_t *pNbData, uint32_t *pVDO)
{
/* USER CODE BEGIN USBPD_VDM_SendUVDM */
/* USER CODE END USBPD_VDM_SendUVDM */
}
/**
* @brief Unstructured VDM message callback to inform user of reception of UVDM message
* @param PortNum current port number
* @param UVDM_Header UVDM header based on @ref USBPD_UVDMHeader_TypeDef
* @param pNbData Pointer of number of received VDO
* @param pVDO Pointer of received VDO
* @retval USBPD Status
*/
static USBPD_StatusTypeDef USBPD_VDM_ReceiveUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef UVDM_Header, uint8_t *pNbData, uint32_t *pVDO)
{
/* USER CODE BEGIN USBPD_VDM_ReceiveUVDM */
return USBPD_ERROR;
/* USER CODE END USBPD_VDM_ReceiveUVDM */
}