CC26xx Driver Library |

- Main Page
- Related Pages
- CC26xx APIs
- Register Descriptions
- Online Resources

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vims.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: vims.h
3 * Revised: 2015-01-14 12:12:44 +0100 (on, 14 jan 2015)
4 * Revision: 42373
5 *
6 * Description: Defines and prototypes for the VIMS.
7 *
8 * Copyright (c) 2015, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38
39 //*****************************************************************************
40 //
43 //
44 //*****************************************************************************
45
46 #ifndef __VIMS_H__
47 #define __VIMS_H__
48
49 //*****************************************************************************
50 //
51 // If building with a C++ compiler, make all of the definitions in this header
52 // have a C binding.
53 //
54 //*****************************************************************************
55 #ifdef __cplusplus
56 extern "C"
57 {
58 #endif
59
60 #include <stdbool.h>
61 #include <stdint.h>
62 #include <inc/hw_types.h>
63 #include <inc/hw_memmap.h>
64 #include <inc/hw_vims.h>
65 #include <driverlib/debug.h>
66
67 //*****************************************************************************
68 //
69 // Support for DriverLib in ROM:
70 // This section renames all functions that are not "static inline", so that
71 // calling these functions will default to implementation in flash. At the end
72 // of this file a second renaming will change the defaults to implementation in
73 // ROM for available functions.
74 //
75 // To force use of the implementation in flash, e.g. for debugging:
76 // - Globally: Define DRIVERLIB_NOROM at project level
77 // - Per function: Use prefix "NOROM_" when calling the function
78 //
79 // Do not define DRIVERLIB_GENERATE_ROM!
80 //
81 //*****************************************************************************
82 #ifndef DRIVERLIB_GENERATE_ROM
83 #define VIMSConfigure NOROM_VIMSConfigure
84 #define VIMSModeSet NOROM_VIMSModeSet
85 #define VIMSModeGet NOROM_VIMSModeGet
86 #define VIMSModeSetBlocking NOROM_VIMSModeSetBlocking
87 #endif
88
89 //*****************************************************************************
90 //
91 // Values that can be passed to VIMSModeSet() as the ui32IntFlags parameter,
92 // and returned from VIMSModeGet().
93 //
94 //*****************************************************************************
95 #define VIMS_MODE_INVALIDATE 0x4 // Cache RAM is being invalidated, will
96 // transition to DISABLED when cache RAM
97 // is all zeros.
98 #define VIMS_MODE_DISABLED 0x0 // Disabled mode.
99 #define VIMS_MODE_ENABLED 0x1 // Enabled mode, only USERCODE is cached.
100 #define VIMS_MODE_SPLIT 0x2 // Split mode, both USERCODE and SYSCODE
101 // will be cached.
102 #define VIMS_MODE_OFF 0x3 // VIMS Cache RAM is off
103
104 //*****************************************************************************
105 //
106 // API Functions and prototypes
107 //
108 //*****************************************************************************
109
110 #ifdef DRIVERLIB_DEBUG
111 //*****************************************************************************
112 //
121 //
122 //*****************************************************************************
123 static bool
124 VIMSBaseValid(uint32_t ui32Base)
125 {
126 return(ui32Base == VIMS_BASE);
127 }
128 #endif
129
130 //*****************************************************************************
131 //
151 //
152 //*****************************************************************************
153 extern void VIMSConfigure(uint32_t ui32Base, bool bRoundRobin,
154 bool bPrefetch);
155
156 //*****************************************************************************
157 //
214 //
215 //*****************************************************************************
216 extern void VIMSModeSet(uint32_t ui32Base, uint32_t ui32Mode);
217
218 //*****************************************************************************
219 //
234 //
235 //*****************************************************************************
236 extern uint32_t VIMSModeGet(uint32_t ui32Base);
237
238 //*****************************************************************************
239 //
295 //
296 //*****************************************************************************
297 extern void VIMSModeSetBlocking( uint32_t ui32Mode );
298
299 //*****************************************************************************
300 //
309 //
310 //*****************************************************************************
311 __STATIC_INLINE void
312 VIMSLineBufDisable(uint32_t ui32Base)
313 {
314 //
315 // Disable line buffers
316 //
317 HWREG(ui32Base + VIMS_O_CTL) |= VIMS_CTL_IDCODE_LB_DIS_M |
318 VIMS_CTL_SYSBUS_LB_DIS_M;
319 }
320
321 //*****************************************************************************
322 //
331 //
332 //*****************************************************************************
333 __STATIC_INLINE void
334 VIMSLineBufEnable(uint32_t ui32Base)
335 {
336 //
337 // Enable linebuffers
338 //
339 HWREG(ui32Base + VIMS_O_CTL) &= ~(VIMS_CTL_IDCODE_LB_DIS_M |
340 VIMS_CTL_SYSBUS_LB_DIS_M);
341 }
342
343 //*****************************************************************************
344 //
345 // Support for DriverLib in ROM:
346 // Redirect to implementation in ROM when available.
347 //
348 //*****************************************************************************
349 #ifndef DRIVERLIB_NOROM
350 #include <driverlib/rom.h>
351 #ifdef ROM_VIMSConfigure
352 #undef VIMSConfigure
353 #define VIMSConfigure ROM_VIMSConfigure
354 #endif
355 #ifdef ROM_VIMSModeSet
356 #undef VIMSModeSet
357 #define VIMSModeSet ROM_VIMSModeSet
358 #endif
359 #ifdef ROM_VIMSModeGet
360 #undef VIMSModeGet
361 #define VIMSModeGet ROM_VIMSModeGet
362 #endif
363 #ifdef ROM_VIMSModeSetBlocking
364 #undef VIMSModeSetBlocking
365 #define VIMSModeSetBlocking ROM_VIMSModeSetBlocking
366 #endif
367 #endif
368
369 //*****************************************************************************
370 //
371 // Mark the end of the C bindings section for C++ compilers.
372 //
373 //*****************************************************************************
374 #ifdef __cplusplus
375 }
376 #endif
377
378 #endif // __VIMS_H__
379
380 //*****************************************************************************
381 //
384 //
385 //*****************************************************************************
VIMSModeSet
void VIMSModeSet(uint32_t ui32Base, uint32_t ui32Mode)
Set the operational mode of the VIMS.
Definition: vims.c:96
VIMSLineBufDisable
__STATIC_INLINE void VIMSLineBufDisable(uint32_t ui32Base)
Disable VIMS linebuffers.
Definition: vims.h:312
debug.h
VIMSLineBufEnable
__STATIC_INLINE void VIMSLineBufEnable(uint32_t ui32Base)
Enable VIMS linebuffers.
Definition: vims.h:334
VIMSModeGet
uint32_t VIMSModeGet(uint32_t ui32Base)
Get the current operational mode of the VIMS.
Definition: vims.c:127
rom.h
VIMSModeSetBlocking
void VIMSModeSetBlocking(uint32_t ui32Mode)
Set the operational mode of the VIMS in a safe sequence (blocking).
Definition: vims.c:157
VIMSConfigure
void VIMSConfigure(uint32_t ui32Base, bool bRoundRobin, bool bPrefetch)
Configures the VIMS.
Definition: vims.c:64