AM275 FreeRTOS SDK  11.02.00
hyperRam.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
33 
42  #ifndef hyperRam_H_
43  #define hyperRam_H_
44 
45 
46 /* ========================================================================== */
47 /* Include Files */
48 /* ========================================================================== */
49 
50 #include <stdint.h>
51 #include <kernel/dpl/SystemP.h>
52 #include <drivers/hw_include/soc_config.h>
53 #include <drivers/hyperbus.h>
54 #include <kernel/dpl/SemaphoreP.h>
55 
56  #ifdef __cplusplus
57  extern "C"
58  {
59  #endif
60 
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
64 
78  typedef void *HYPERRAM_Handle;
79 
83  typedef struct HyperRam_Config_s HyperRam_Config;
84 
85 /* ========================================================================== */
86 /* Structure Declarations */
87 /* ========================================================================== */
88 
92  typedef struct HyperRam_Attrs_s {
93  char *HyperRamName;
95  uint32_t driverInstance;
97  uint16_t CR0;
99  uint16_t CR1;
101  uint16_t ID0;
103  uint16_t ID1;
106  } HyperRam_Attrs;
107 
112  {
115  void *object;
118  };
119 
120 /* ========================================================================== */
121 /* Function Declarations */
122 /* ========================================================================== */
123 
127 void HyperRam_init(void);
128 
132 void HyperRam_deinit(void);
133 
151 HYPERRAM_Handle HyperRam_open(uint32_t instanceId);
152 
159 
162 /* ========================================================================== */
163 /* Static Function Definitions */
164 /* ========================================================================== */
165 
166 /* None */
167 
168 /* ========================================================================== */
169 /* Internal/Private Structure Declarations */
170 /* ========================================================================== */
171 
172 typedef struct {
177  uint32_t isOpen;
182  } HyperRam_Object;
183 
184  #ifdef __cplusplus
185  }
186  #endif
187 
188  #endif /* hyperRam_H_ */
HyperRam_Object::hyperbusHandle
HYPERBUS_Handle hyperbusHandle
Definition: hyperRam.h:175
HyperRam_Attrs::driverInstance
uint32_t driverInstance
Definition: hyperRam.h:95
SystemP.h
HyperRam_Attrs::CR1
uint16_t CR1
Definition: hyperRam.h:99
HyperRam_init
void HyperRam_init(void)
This function initializes the HYPERBUS module.
HyperRam_deinit
void HyperRam_deinit(void)
This function de-initializes the HYPERBUS module.
HYPERBUS_Handle
void * HYPERBUS_Handle
A handle that is returned from a HYPERBUS_open() call.
Definition: hyperbus/v0/hyperbus.h:68
HyperRam_Attrs
HyperRam device attributes, these are filled by SysCfg based on the HyperRam device that is selected.
Definition: hyperRam.h:92
SemaphoreP.h
HyperRam_Attrs::HyperRamName
char * HyperRamName
Definition: hyperRam.h:93
HyperRam_close
void HyperRam_close(HYPERRAM_Handle handle)
Close HyperRam driver.
HyperRam_Attrs::ID1
uint16_t ID1
Definition: hyperRam.h:103
HyperRam_Object
Definition: hyperRam.h:172
HyperRam_Attrs::CR0
uint16_t CR0
Definition: hyperRam.h:97
HyperRam_Object::handle
HYPERRAM_Handle handle
Definition: hyperRam.h:173
HyperRam_Config_s::attrs
HyperRam_Attrs * attrs
Definition: hyperRam.h:113
HyperRam_Attrs::ID0
uint16_t ID0
Definition: hyperRam.h:101
hyperbus.h
HyperRam_Object::lockObj
SemaphoreP_Object lockObj
Definition: hyperRam.h:179
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
HyperRam_Object::isOpen
uint32_t isOpen
Definition: hyperRam.h:177
HyperRam_Config_s
HyperRam driver configuration, these are filled by SysCfg based on the HyperRam device that is select...
Definition: hyperRam.h:112
HYPERRAM_Handle
void * HYPERRAM_Handle
Handle to the HYPERRAM driver returned by HyperRam_open()
Definition: hyperRam.h:78
HyperRam_open
HYPERRAM_Handle HyperRam_open(uint32_t instanceId)
Open HyperRam driver.
HyperRam_Config_s::object
void * object
Definition: hyperRam.h:115