MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

spintac_version.h
Go to the documentation of this file.
1 #ifndef __SPINTAC_VERSION_H__
2 #define __SPINTAC_VERSION_H__
3 /* --COPYRIGHT--,BSD
4 * Copyright (c) 2012, LineStream Technologies Incorporated
5 * Copyright (c) 2012, Texas Instruments Incorporated
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * * Neither the names of Texas Instruments Incorporated, LineStream
20 * Technologies Incorporated, nor the names of its contributors may be
21 * used to endorse or promote products derived from this software without
22 * specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
31 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
34 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * --/COPYRIGHT--*/
36
43
45
46
48 typedef enum {
49 FIXED_POINT_16b = 0,
50 FIXED_POINT_32b,
51 FLOAT_POINT_32b
52 } ST_MathType_e;
53
57 typedef struct {
58 uint16_t Major;
59 uint16_t Minor;
60 uint16_t Revision;
61 ST_MathType_e MathType;
62 uint32_t SecureROM;
63 int32_t Date;
64 uint_least8_t Label[10];
65 } ST_Ver_t; // Structure for SpinTAC Version
66
67 typedef struct _ST_VER_Handle_ *ST_VER_Handle; // SpinTAC Version Handle
68
74 static inline void ST_getVersionNumber(ST_VER_Handle handle, uint16_t *major, uint16_t *minor, uint16_t *revision) {
75 ST_Ver_t *obj = (ST_Ver_t *)handle;
76
77 *major = obj->Major;
78 *minor = obj->Minor;
79 *revision = obj->Revision;
80 } // end of ST_getVersionNumber function
81
85 static inline int32_t ST_getVersionMath(ST_VER_Handle handle) {
86 ST_Ver_t *obj = (ST_Ver_t *)handle;
87
88 return(obj->MathType);
89 } // end of ST_getVersionMath function
90
94 static inline int32_t ST_getVersionDate(ST_VER_Handle handle) {
95 ST_Ver_t *obj = (ST_Ver_t *)handle;
96
97 return(obj->Date);
98 } // end of ST_getVersionDate function
99
103 static inline int32_t ST_getSecureROMVersion(ST_VER_Handle handle) {
104 ST_Ver_t *obj = (ST_Ver_t *)handle;
105
106 return(obj->SecureROM);
107 } // end of ST_getSecureROMVersion function
108
113 ST_VER_Handle ST_initVersion(void *pMemory, const size_t numBytes);
114
116 #endif //__SPINTAC_VERSION_H__
ST_getVersionNumber
static void ST_getVersionNumber(ST_VER_Handle handle, uint16_t *major, uint16_t *minor, uint16_t *revision)
Gets the Version Number (Major, Minor, Revision) for SpinTAC Version.
Definition: spintac_version.h:74
FIXED_POINT_16b
Definition: spintac_version.h:49
ST_MathType_e
ST_MathType_e
Defines the math implementations available for the SpinTAC Library.
Definition: spintac_version.h:48
FLOAT_POINT_32b
Definition: spintac_version.h:51
ST_getVersionMath
static int32_t ST_getVersionMath(ST_VER_Handle handle)
Gets the Version Math Implementation (FixedPt) for SpinTAC Version.
Definition: spintac_version.h:85
ST_getSecureROMVersion
static int32_t ST_getSecureROMVersion(ST_VER_Handle handle)
Gets the ROM Version Number (SecureROM) for SpinTAC Version.
Definition: spintac_version.h:103
ST_Ver_t::Major
uint16_t Major
Definition: spintac_version.h:58
ST_VER_Handle
struct _ST_VER_Handle_ * ST_VER_Handle
Definition: spintac_version.h:67
ST_Ver_t
Defines the version data.
Definition: spintac_version.h:57
ST_Ver_t::MathType
ST_MathType_e MathType
Definition: spintac_version.h:61
ST_Ver_t::Minor
uint16_t Minor
Definition: spintac_version.h:59
ST_Ver_t::Revision
uint16_t Revision
Definition: spintac_version.h:60
ST_Ver_t::SecureROM
uint32_t SecureROM
Definition: spintac_version.h:62
ST_getVersionDate
static int32_t ST_getVersionDate(ST_VER_Handle handle)
Gets the Version Date (Date) for SpinTAC Version.
Definition: spintac_version.h:94
ST_initVersion
ST_VER_Handle ST_initVersion(void *pMemory, const size_t numBytes)
Initializes the SpinTAC Version object.
FIXED_POINT_32b
Definition: spintac_version.h:50
ST_Ver_t::Date
int32_t Date
Definition: spintac_version.h:63