Skip to content
Permalink
2604b1d2a3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 201 lines (184 sloc) 6.85 KB
/***************************************************************************//**
* \file cy_qistack_pm.h
* \version 2.0
*
* Header file of Qi Policy Manager of the QiStack middleware.
*
********************************************************************************
* \copyright
* Copyright 2022-2023, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#ifndef CY_QISTACK_PM_H
#define CY_QISTACK_PM_H
#include "cy_qistack_common.h"
/*******************************************************************************
* Type Definitions
*******************************************************************************/
/**
* \addtogroup group_qistack_functions
* \{
*/
/*******************************************************************************
* Function Name: Cy_QiStack_Init
****************************************************************************//**
*
* This function initializes the Qi policy manager with callback pointers
* and loads the configuration information from the config table.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \param ptrCfg
* Configuration pointer.
*
* \param ptrAppCbk
* Application callback function pointer.
*
* \param ptrTimerContext
* Pointer to soft timer context structure.
*
* \return
* CY_QISTACK_STAT_SUCCESS if operation is successful
* CY_QISTACK_STAT_BAD_PARAM if the input parameters are not valid
*
*******************************************************************************/
cy_en_qi_status_t Cy_QiStack_Init(
/* Pointer to the qistack context. Will be initialized as part of this function. */
cy_stc_qi_context_t *qiCtx,
/* Pointer to the config structure - generated by the ez-pd configurator. */
const void * ptrCfg,
/* Pointer to the application callbacks. */
cy_stc_qi_app_cbk_t * ptrAppCbk,
/* Pointer to soft timer context. */
cy_stc_pdutils_sw_timer_t *ptrTimerContext);
/*******************************************************************************
* Function Name: Cy_QiStack_Start
****************************************************************************//**
*
* This function starts or restarts the Qi stack policy with latest policy data.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \return
* CY_QISTACK_STAT_SUCCESS if operation is successful
* CY_QISTACK_STAT_BAD_PARAM if the context pointer is invalid
* CY_QISTACK_STAT_FAILURE if the operation fails.
*
*******************************************************************************/
cy_en_qi_status_t Cy_QiStack_Start(
cy_stc_qi_context_t *qiCtx);
/*******************************************************************************
* Function Name: Cy_QiStack_Stop
****************************************************************************//**
*
* This function stops the Qi stack policy.
* Qi stack policy stays in IDLE state until start.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \return
* CY_QISTACK_STAT_SUCCESS if operation is successful
* CY_QISTACK_STAT_BAD_PARAM if the context pointer is invalid
* CY_QISTACK_STAT_FAILURE if the operation fails.
*
*******************************************************************************/
cy_en_qi_status_t Cy_QiStack_Stop(
cy_stc_qi_context_t *qiCtx);
/*******************************************************************************
* Function Name: Cy_QiStack_Task
****************************************************************************//**
*
* This function runs the Qi stack policy.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \return
* CY_QISTACK_STAT_SUCCESS if operation is successful
* CY_QISTACK_STAT_BAD_PARAM if the context pointer is invalid
*
*******************************************************************************/
cy_en_qi_status_t Cy_QiStack_Task(
cy_stc_qi_context_t *qiCtx);
/*******************************************************************************
* Function Name: Cy_QiStack_Is_Sleep_Alowed
****************************************************************************//**
*
* This function returns Qi stack Sleep entry status.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \return
* True if Sleep allowed, otherwise False.
*
*******************************************************************************/
bool Cy_QiStack_Is_Sleep_Alowed(
cy_stc_qi_context_t *qiCtx);
/*******************************************************************************
* Function Name: Cy_QiStack_Is_DeepSleep_Alowed
****************************************************************************//**
*
* This function returns Qi stack Deep Sleep entry status.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \return
* True if Sleep allowed, otherwise False.
*
*******************************************************************************/
bool Cy_QiStack_Is_DeepSleep_Alowed(
cy_stc_qi_context_t *qiCtx);
/*******************************************************************************
* Function Name: Cy_QiStack_Register_Usbpd
****************************************************************************//**
*
* This function register USBPD hardware contexts with Qi policy.
* This is device specific function and may not be available on all devices.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \param ptrUsbPd0Context
* UsbPd Instance 0 Driver Context pointer.
*
* \param ptrUsbPd1Context
* UsbPd Instance 1 Driver Context pointer.
*
* \return
* CY_QISTACK_STAT_SUCCESS if operation is successful
* CY_QISTACK_STAT_BAD_PARAM if the input parameters are not valid
*
*******************************************************************************/
cy_en_qi_status_t Cy_QiStack_Register_Usbpd(
cy_stc_qi_context_t *qiCtx,
cy_stc_usbpd_context_t *ptrUsbPd0Context,
cy_stc_usbpd_context_t *ptrUsbPd1Context);
/*******************************************************************************
* Function Name: Cy_QiStack_Update_Guaranteed_Max_Power
****************************************************************************//**
*
* This function updates the Guaranteed and maxpower values in capability message for FSK.
*
* \param qiCtx
* QiStack Library Context pointer.
*
* \return
* True if Stack was able to update the FSK Cap message buffer , otherwise False.
*
*******************************************************************************/
bool Cy_QiStack_Update_Guaranteed_Max_Power(cy_stc_qi_context_t *qiCtx, uint8_t gPowerVal, uint8_t maxPowerVal);
/**
* @brief
*
*/
void Cy_Qistack_Auth_Start_Transmission(cy_stc_qi_context_t *qiCtx, uint16_t buffer_size);
/** \} group_qistack_functions */
#endif /* CY_QISTACK_PM_H */
/* [] END OF FILE */