1 //###########################################################################
2 //
3 // FILE:   F2837xD_Cla_typedefs.h
4 //
5 // TITLE:  Variable type definitions
6 //
7 //###########################################################################
8 // $TI Release: F2837xD Support Library v3.05.00.00 $
9 // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
10 // $Copyright:
11 // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
12 //
13 // Redistribution and use in source and binary forms, with or without
14 // modification, are permitted provided that the following conditions
15 // are met:
16 //
17 //   Redistributions of source code must retain the above copyright
18 //   notice, this list of conditions and the following disclaimer.
19 //
20 //   Redistributions in binary form must reproduce the above copyright
21 //   notice, this list of conditions and the following disclaimer in the
22 //   documentation and/or other materials provided with the
23 //   distribution.
24 //
25 //   Neither the name of Texas Instruments Incorporated nor the names of
26 //   its contributors may be used to endorse or promote products derived
27 //   from this software without specific prior written permission.
28 //
29 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 // $
41 //###########################################################################
42 
43 #ifndef F2837xD_CLA_TYPEDEFS_H_
44 #define F2837xD_CLA_TYPEDEFS_H_
45 
46 //
47 // Macros to manipulate pre-processor to generate a header file name
48 // at compile time that is based on the test name and can be used as
49 // an argument to #include
50 //
51 #define XSTRINGIZE(s) STRINGIZE(s)
52 #define STRINGIZE(s) #s
53 #define XCONCAT(x,y) CONCAT(x,y)
54 #define CONCAT(x,y) x##y
55 
56 //
57 // Suppress warnings casting CLA pointers
58 //
59 #pragma diag_suppress 70,770,232
60 
61 #ifdef __TMS320C28XX_CLA__
62 //
63 // For Portability, User Is Recommended To Use Following Data Type Size
64 // Definitions For 16-bit and 32-Bit Signed/Unsigned Integers:
65 //
66 // CLA does not support 64-bit types
67 // This definition is only to allow inclusion of the standard header files
68 // which do use 64-bit types
69 //
70 
71 #if (!defined(F28_DATA_TYPES) && !defined(DSP28_DATA_TYPES))
72 #define F28_DATA_TYPES
73 #define DSP28_DATA_TYPES
74 typedef short                                   int16;
75 typedef long                                    int32;
76 typedef unsigned char                           Uint8;
77 typedef unsigned short                          Uint16;
78 typedef unsigned long                           Uint32;
79 typedef float                                   float32;
80 typedef long double                             float64;
81 typedef struct { Uint32 low32; Uint32 high32; } Uint64;
82 typedef struct { int32  low32; int32  high32; } int64;
83 #else
84 #error F2837xD_Cla_Typedefs.h must be included before F2837xD_Device.h or any other header \
85 file that redefines data types using the guard macros F28_DATA_TYPES or DSP28_DATA_TYPES
86 #endif //(!defined(F28_DATA_TYPES) && !defined(DSP28_DATA_TYPES))
87 
88 #ifndef _TI_STD_TYPES
89 #define _TI_STD_TYPES
90 //
91 //These types are also defined in DSP/BIOS 5.x's <std.h> and the
92 //SYS/BIOS 6.x's <xdc/std.h> files.  We need to protect their
93 //definition with the #ifndef/#define guard to avoid the duplicate
94 //definition warning.
95 //
96 //SYS/BIOS requires that the <xdc/std.h> file be included before
97 //any other .h files.
98 //
99 #endif
100 
101 struct MSTF_SHADOW_BITS {   // bits description
102     Uint16  LVF:1;          // 0    Latched Overflow Flag
103     Uint16  LUF:1;          // 1    Latched Underflow Flag
104     Uint16  NF:1;           // 2    Negative Float Flag
105     Uint16  ZF:1;           // 3    Zero Float Flag
106     Uint16  rsvd1:2;        // 5:4  Reserved
107     Uint16  TF:1;           // 6    Test Flag
108     Uint16  rsvd2:2;        // 8:7  Reserved
109     Uint16  RNDF32:1;       // 9    Rounding Mode
110     Uint16  rsvd3:1;        // 10   Reserved
111     Uint16  MEALLOW:1;      // 11   MEALLOW Status
112     Uint16  RPCL:4;         // 15:12    Return PC: Low Portion
113     Uint16  RPCH:8;         // 23:16    Return PC: High Portion
114     Uint16  rsvd4:8;        // 31:24    Reserved
115 };
116 extern __cregister volatile unsigned int MSTF;
117 
118 #endif //__TMS320C28XX_CLA__
119 
120 #ifndef __TMS320C28XX__
121 #define __cregister
122 #endif  //__TMS320C28xx__
123 
124 #endif //F2837xD_CLA_TYPEDEFS_H_
125 
126 //
127 // End of file
128 //
129