CC26xx Driver Library
vims.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: vims.h
3 * Revised: 2016-06-30 09:21:03 +0200 (Thu, 30 Jun 2016)
4 * Revision: 46799
5 *
6 * Description: Defines and prototypes for the VIMS.
7 *
8 * Copyright (c) 2015 - 2016, 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 VIMSModeSafeSet NOROM_VIMSModeSafeSet
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 (VIMS_CTL_MODE_GPRAM) // Disabled mode (GPRAM enabled).
98 #define VIMS_MODE_ENABLED (VIMS_CTL_MODE_CACHE) // Enabled mode, only USERCODE is cached.
99 #define VIMS_MODE_OFF (VIMS_CTL_MODE_OFF) // VIMS Cache RAM is off
100 
101 //*****************************************************************************
102 //
103 // API Functions and prototypes
104 //
105 //*****************************************************************************
106 
107 #ifdef DRIVERLIB_DEBUG
108 //*****************************************************************************
109 //
118 //
119 //*****************************************************************************
120 static bool
121 VIMSBaseValid(uint32_t ui32Base)
122 {
123  return(ui32Base == VIMS_BASE);
124 }
125 #endif
126 
127 //*****************************************************************************
128 //
148 //
149 //*****************************************************************************
150 extern void VIMSConfigure(uint32_t ui32Base, bool bRoundRobin,
151  bool bPrefetch);
152 
153 //*****************************************************************************
154 //
205 //
206 //*****************************************************************************
207 extern void VIMSModeSet(uint32_t ui32Base, uint32_t ui32Mode);
208 
209 //*****************************************************************************
210 //
224 //
225 //*****************************************************************************
226 extern uint32_t VIMSModeGet(uint32_t ui32Base);
227 
228 //*****************************************************************************
229 //
278 //
279 //*****************************************************************************
280 extern void VIMSModeSafeSet( uint32_t ui32Base ,
281  uint32_t ui32NewMode ,
282  bool blocking );
283 
284 //*****************************************************************************
285 //
296 //
297 //*****************************************************************************
298 __STATIC_INLINE void
299 VIMSLineBufDisable(uint32_t ui32Base)
300 {
301  //
302  // Disable line buffers
303  //
304  HWREG(ui32Base + VIMS_O_CTL) |= VIMS_CTL_IDCODE_LB_DIS_M |
306 }
307 
308 //*****************************************************************************
309 //
320 //
321 //*****************************************************************************
322 __STATIC_INLINE void
323 VIMSLineBufEnable(uint32_t ui32Base)
324 {
325  //
326  // Enable linebuffers
327  //
328  HWREG(ui32Base + VIMS_O_CTL) &= ~(VIMS_CTL_IDCODE_LB_DIS_M |
330 }
331 
332 //*****************************************************************************
333 //
334 // Support for DriverLib in ROM:
335 // Redirect to implementation in ROM when available.
336 //
337 //*****************************************************************************
338 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
339  #include <driverlib/rom.h>
340  #ifdef ROM_VIMSConfigure
341  #undef VIMSConfigure
342  #define VIMSConfigure ROM_VIMSConfigure
343  #endif
344  #ifdef ROM_VIMSModeSet
345  #undef VIMSModeSet
346  #define VIMSModeSet ROM_VIMSModeSet
347  #endif
348  #ifdef ROM_VIMSModeGet
349  #undef VIMSModeGet
350  #define VIMSModeGet ROM_VIMSModeGet
351  #endif
352  #ifdef ROM_VIMSModeSafeSet
353  #undef VIMSModeSafeSet
354  #define VIMSModeSafeSet ROM_VIMSModeSafeSet
355  #endif
356 #endif
357 
358 //*****************************************************************************
359 //
360 // Mark the end of the C bindings section for C++ compilers.
361 //
362 //*****************************************************************************
363 #ifdef __cplusplus
364 }
365 #endif
366 
367 #endif // __VIMS_H__
368 
369 //*****************************************************************************
370 //
374 //
375 //*****************************************************************************
void VIMSModeSet(uint32_t ui32Base, uint32_t ui32Mode)
Set the operational mode of the VIMS.
Definition: vims.c:96
void VIMSModeSafeSet(uint32_t ui32Base, uint32_t ui32NewMode, bool blocking)
Set the operational mode of the VIMS in a safe sequence.
Definition: vims.c:153
uint32_t VIMSModeGet(uint32_t ui32Base)
Get the current operational mode of the VIMS.
Definition: vims.c:125
static void VIMSLineBufDisable(uint32_t ui32Base)
Disable VIMS linebuffers.
Definition: vims.h:299
static void VIMSLineBufEnable(uint32_t ui32Base)
Enable VIMS linebuffers.
Definition: vims.h:323
void VIMSConfigure(uint32_t ui32Base, bool bRoundRobin, bool bPrefetch)
Configures the VIMS.
Definition: vims.c:64