CC26xx Driver Library
vims.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: vims.h
3 * Revised: 2015-07-16 12:12:04 +0200 (Thu, 16 Jul 2015)
4 * Revision: 44151
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 //
45 //
46 //*****************************************************************************
47 
48 #ifndef __VIMS_H__
49 #define __VIMS_H__
50 
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 #include <stdbool.h>
63 #include <stdint.h>
64 #include <inc/hw_types.h>
65 #include <inc/hw_memmap.h>
66 #include <inc/hw_vims.h>
67 #include <driverlib/debug.h>
68 
69 //*****************************************************************************
70 //
71 // Support for DriverLib in ROM:
72 // This section renames all functions that are not "static inline", so that
73 // calling these functions will default to implementation in flash. At the end
74 // of this file a second renaming will change the defaults to implementation in
75 // ROM for available functions.
76 //
77 // To force use of the implementation in flash, e.g. for debugging:
78 // - Globally: Define DRIVERLIB_NOROM at project level
79 // - Per function: Use prefix "NOROM_" when calling the function
80 //
81 //*****************************************************************************
82 #if !defined(DOXYGEN)
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_CHANGING 0x4 // VIMS mode is changing now and VIMS_MODE
96  // can not be changed at moment.
97 #define VIMS_MODE_DISABLED 0x0 // Disabled mode.
98 #define VIMS_MODE_ENABLED 0x1 // Enabled mode, only USERCODE is cached.
99 #define VIMS_MODE_SPLIT 0x2 // Split mode, both USERCODE and SYSCODE
100  // will be cached.
101 #define VIMS_MODE_OFF 0x3 // VIMS Cache RAM is off
102 
103 //*****************************************************************************
104 //
105 // API Functions and prototypes
106 //
107 //*****************************************************************************
108 
109 #ifdef DRIVERLIB_DEBUG
110 //*****************************************************************************
111 //
120 //
121 //*****************************************************************************
122 static bool
123 VIMSBaseValid(uint32_t ui32Base)
124 {
125  return(ui32Base == VIMS_BASE);
126 }
127 #endif
128 
129 //*****************************************************************************
130 //
150 //
151 //*****************************************************************************
152 extern void VIMSConfigure(uint32_t ui32Base, bool bRoundRobin,
153  bool bPrefetch);
154 
155 //*****************************************************************************
156 //
212 //
213 //*****************************************************************************
214 extern void VIMSModeSet(uint32_t ui32Base, uint32_t ui32Mode);
215 
216 //*****************************************************************************
217 //
232 //
233 //*****************************************************************************
234 extern uint32_t VIMSModeGet(uint32_t ui32Base);
235 
236 //*****************************************************************************
237 //
292 //
293 //*****************************************************************************
294 extern void VIMSModeSetBlocking( uint32_t ui32Mode );
295 
296 //*****************************************************************************
297 //
308 //
309 //*****************************************************************************
310 __STATIC_INLINE void
311 VIMSLineBufDisable(uint32_t ui32Base)
312 {
313  //
314  // Disable line buffers
315  //
316  HWREG(ui32Base + VIMS_O_CTL) |= VIMS_CTL_IDCODE_LB_DIS_M |
318 }
319 
320 //*****************************************************************************
321 //
332 //
333 //*****************************************************************************
334 __STATIC_INLINE void
335 VIMSLineBufEnable(uint32_t ui32Base)
336 {
337  //
338  // Enable linebuffers
339  //
340  HWREG(ui32Base + VIMS_O_CTL) &= ~(VIMS_CTL_IDCODE_LB_DIS_M |
342 }
343 
344 //*****************************************************************************
345 //
346 // Support for DriverLib in ROM:
347 // Redirect to implementation in ROM when available.
348 //
349 //*****************************************************************************
350 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
351  #include <driverlib/rom.h>
352  #ifdef ROM_VIMSConfigure
353  #undef VIMSConfigure
354  #define VIMSConfigure ROM_VIMSConfigure
355  #endif
356  #ifdef ROM_VIMSModeSet
357  #undef VIMSModeSet
358  #define VIMSModeSet ROM_VIMSModeSet
359  #endif
360  #ifdef ROM_VIMSModeGet
361  #undef VIMSModeGet
362  #define VIMSModeGet ROM_VIMSModeGet
363  #endif
364  #ifdef ROM_VIMSModeSetBlocking
365  #undef VIMSModeSetBlocking
366  #define VIMSModeSetBlocking ROM_VIMSModeSetBlocking
367  #endif
368 #endif
369 
370 //*****************************************************************************
371 //
372 // Mark the end of the C bindings section for C++ compilers.
373 //
374 //*****************************************************************************
375 #ifdef __cplusplus
376 }
377 #endif
378 
379 #endif // __VIMS_H__
380 
381 //*****************************************************************************
382 //
386 //
387 //*****************************************************************************
void VIMSModeSet(uint32_t ui32Base, uint32_t ui32Mode)
Set the operational mode of the VIMS.
Definition: vims.c:96
uint32_t VIMSModeGet(uint32_t ui32Base)
Get the current operational mode of the VIMS.
Definition: vims.c:126
static void VIMSLineBufDisable(uint32_t ui32Base)
Disable VIMS linebuffers.
Definition: vims.h:311
static void VIMSLineBufEnable(uint32_t ui32Base)
Enable VIMS linebuffers.
Definition: vims.h:335
void VIMSModeSetBlocking(uint32_t ui32Mode)
Set the operational mode of the VIMS in a safe sequence (blocking).
Definition: vims.c:156
void VIMSConfigure(uint32_t ui32Base, bool bRoundRobin, bool bPrefetch)
Configures the VIMS.
Definition: vims.c:64