1 /*
2  * Copyright 2022, Cypress Semiconductor Corporation (an Infineon company)
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /** @file
19  *  Provides prototypes / declarations for common APSTA functionality
20  */
21 #ifndef _WHD_INTERNAL_RESOURCE_API_H_
22 #define _WHD_INTERNAL_RESOURCE_API_H_
23 
24 #include "whd.h"
25 #include "whd_int.h"
26 #include "whd_resource_api.h"
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 /******************************************************
34 *                      Macros
35 ******************************************************/
36 
37 /******************************************************
38 *             Structures
39 ******************************************************/
40 
41 /******************************************************
42 *             Function prototypes
43 ******************************************************/
44 uint32_t whd_resource_size(whd_driver_t whd_driver, whd_resource_type_t resource, uint32_t *size_out);
45 uint32_t whd_get_resource_block_size(whd_driver_t whd_drv, whd_resource_type_t type, uint32_t *size_out);
46 uint32_t whd_get_resource_no_of_blocks(whd_driver_t whd_drv, whd_resource_type_t type, uint32_t *block_count);
47 uint32_t whd_get_resource_block(whd_driver_t whd_driver, whd_resource_type_t type,
48                                 uint32_t blockno, const uint8_t **data, uint32_t *size_out);
49 
50 uint32_t whd_resource_read(whd_driver_t whd_driver, whd_resource_type_t type, uint32_t offset,
51                            uint32_t size, uint32_t *size_out, void *buffer);
52 
53 #ifdef __cplusplus
54 } /*extern "C" */
55 #endif
56 
57 #endif /* ifndef _WHD_INTERNAL_RESOURCE_API_H_ */
58