22
22
* limitations under the License.
23
23
*******************************************************************************/
24
24
25
- /**
26
- * \addtogroup group_abstraction_resource Resource abstraction
27
- * \ingroup group_abstraction
28
- * \{
29
- * Basic abstraction layer for dealing with resources.
30
- *
31
- * \defgroup group_abstraction_resource_macros Macros
32
- * \defgroup group_abstraction_resource_enums Enums
33
- * \defgroup group_abstraction_resource_data_structures Data Structures
34
- * \defgroup group_abstraction_resource_functions Functions
35
- */
36
-
37
25
#pragma once
38
26
39
27
#include <stdint.h>
44
32
extern "C" {
45
33
#endif
46
34
47
- /**
48
- * \addtogroup group_abstraction_resource_macros
49
- * \{
50
- */
35
+ /**
36
+ * \addtogroup group_abstraction_resource Resource Abstraction
37
+ * \{
38
+ *
39
+ * Basic abstraction layer for dealing with resources.
40
+ */
51
41
52
42
/** Error code for when the specified resource operation is not valid. */
53
43
#define CY_RSLT_RSC_ERROR_UNSUPPORTED (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_RESOURCE, 0))
@@ -62,13 +52,6 @@ extern "C" {
62
52
/** Error code for when the specified resource can not be read. */
63
53
#define CY_RSLT_RSC_ERROR_READ (CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_RESOURCE, 5))
64
54
65
- /** \} group_abstraction_resource_macros */
66
-
67
-
68
- /**
69
- * \addtogroup group_abstraction_resource_enums
70
- * \{
71
- */
72
55
/** Different types of memory that the resources can be stored in. */
73
56
typedef enum
74
57
{
@@ -77,15 +60,7 @@ typedef enum
77
60
CY_RESOURCE_IN_EXTERNAL_STORAGE /**< resource location in external storage */
78
61
} cy_resource_location_t ;
79
62
80
- /** \} group_abstraction_resource_enums */
81
-
82
-
83
- /**
84
- * \addtogroup group_abstraction_resource_data_structures
85
- * \{
86
- */
87
-
88
- /** Filesystem handle */
63
+ /** Filesystem handle */
89
64
typedef struct
90
65
{
91
66
unsigned long offset ; /**< Offset to the start of the resource */
@@ -99,19 +74,12 @@ typedef struct
99
74
unsigned long size ; /**< resource size */
100
75
union
101
76
{
102
- cy_filesystem_resource_handle_t fs ; /** < filesystem resource handle */
103
- const uint8_t * mem_data ; /** < memory resource handle */
104
- void * external_storage_context ; /** < external storage context */
105
- } val ;
77
+ cy_filesystem_resource_handle_t fs ; /**< handle for resource in filesystem */
78
+ const uint8_t * mem_data ; /**< handle for resource in internal memory */
79
+ void * external_storage_context ; /**< handle for resource in external storage */
80
+ } val ; /**< low-level handle (type varies depending on resource storage location) */
106
81
} cy_resource_handle_t ;
107
82
108
- /** \} group_abstraction_resource_data_structures */
109
-
110
- /**
111
- * \addtogroup group_abstraction_resource_functions
112
- * \{
113
- */
114
-
115
83
/**
116
84
* \brief return the block size for the resource
117
85
* \param handle handle to a resource
@@ -147,16 +115,15 @@ cy_rslt_t cy_resource_get_block_count(const cy_resource_handle_t *handle, uint32
147
115
cy_rslt_t cy_resource_read (const cy_resource_handle_t * handle , uint32_t blockno , uint8_t * * buffer , uint32_t * size );
148
116
149
117
/**
150
- * \brief optimized version of read for resources stored in memory (\see CY_RESOURCE_IN_MEMORY)
118
+ * \brief optimized version of read for resources stored in memory
119
+ * \see CY_RESOURCE_IN_MEMORY
151
120
* \param handle the handle to the resource
152
121
* \param buffer pointer to receive buffer address from resource. This does NOT need to be freed.
153
122
* \param size location to receive the size of the block read
154
123
* \returns CY_RSLT_SUCCESS if data read, otherwise an error
155
124
*/
156
125
cy_rslt_t cy_resource_readonly_memory (const cy_resource_handle_t * handle , const uint8_t * * buffer , uint32_t * size );
157
126
158
- /** \} group_abstraction_resource_functions */
159
-
160
127
#if defined(__cplusplus )
161
128
}
162
129
#endif
0 commit comments