-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcy_app_dmc_metadata.h
98 lines (83 loc) · 3.33 KB
/
cy_app_dmc_metadata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/***************************************************************************//**
* \file cy_app_dmc_metadata.h
* \version 2.0
*
* \brief
* Dock metadata handler function prototypes
*
********************************************************************************
* \copyright
* Copyright 2024, Cypress Semiconductor Corporation (an Infineon company)
* or an affiliate of 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_APP_DMC_METADATA_H_
#define _CY_APP_DMC_METADATA_H_
#if (CY_APP_DMC_ENABLE || DOXYGEN)
/*******************************************************************************
* Header files including
******************************************************************************/
#include <stdbool.h>
#include "cy_app_dmc_common.h"
/**
* \addtogroup group_pmg_app_common_dmc
* \{
*/
/**
* \addtogroup group_pmg_app_common_dmc_macros
* \{
*/
/*******************************************************************************
* MACRO definition
******************************************************************************/
/** Length of dock status header: sizeof(cy_stc_app_dmc_dock_status_t) - sizeof(cy_stc_app_dmc_devx_status_t) */
#define CY_APP_DMC_DMC_TATUS_HDR_LEN (sizeof(cy_stc_app_dmc_dock_status_t) - (sizeof(cy_stc_app_dmc_devx_status_t) * CY_APP_DMC_MAX_DEV_COUNT))
/** \} group_pmg_app_common_dmc_macros */
/**
* \addtogroup group_pmg_app_common_dmc_functions
* \{
*/
/*****************************************************************************
**************************** Function prototypes ****************************
*****************************************************************************/
/**
* @brief Initialize dock metadata.
* When dock metadata is empty in DMC flash, form the dock metadata by querying
* various devices.
* When dock metadata is valid, copy the dock metadata contents from flash to
* RAM copy. Update the dock metadata in RAM from CDTT parameters and write back
* RAM copy into flash.
*
* @param params Pointer to DMC parameters structure
*
* @return None
*/
void Cy_App_Dmc_InitMetadata(cy_stc_dmc_params_t *params);
/**
* @brief Write dock metadata from RAM to flash
*
* @param init set true to reset metadata update counter; otherwise false.
* @param params pointer to dmc parameters
* @return None
*/
void Cy_App_Dmc_WriteMetadata(bool init, cy_stc_dmc_params_t *params);
/**
* @brief Returns the dock metadata.
* @return Pointer to the dock metadata structure
*/
cy_stc_app_dmc_dock_metadata_t* Cy_App_Dmc_GetDockMetadata(void);
/**
* @brief This function returns current status of the dock
* @return Returns pointer to the dock status structure
*/
cy_stc_app_dmc_dock_status_t* Cy_App_Dmc_GetDockStatus(void);
#if (CY_APP_USR_DEFINED_SN_SUPPORT)
void Cy_App_Dmc_SetSnFlag(uint8_t comp_id, cy_en_dmc_sn_state_t state, cy_stc_dmc_params_t *params);
#endif /* (CY_APP_USR_DEFINED_SN_SUPPORT) */
/** \} group_pmg_app_common_dmc_functions */
/** \} group_pmg_app_common_dmc */
#endif /* (CY_APP_DMC_ENABLE || DOXYGEN) */
#endif /* _CY_APP_DMC_METADATA_H_ */
/* [] END OF FILE */