MotorWare f2806x Module API Documentation
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 {
53 
57 typedef struct {
58  uint16_t Major;
59  uint16_t Minor;
60  uint16_t Revision;
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__
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.
ST_MathType_e
Defines the math implementations available for the SpinTAC Library.
static int32_t ST_getVersionMath(ST_VER_Handle handle)
Gets the Version Math Implementation (FixedPt) for SpinTAC Version.
static int32_t ST_getSecureROMVersion(ST_VER_Handle handle)
Gets the ROM Version Number (SecureROM) for SpinTAC Version.
uint16_t Major
struct _ST_VER_Handle_ * ST_VER_Handle
Defines the version data.
ST_MathType_e MathType
uint16_t Minor
uint16_t Revision
uint32_t SecureROM
static int32_t ST_getVersionDate(ST_VER_Handle handle)
Gets the Version Date (Date) for SpinTAC Version.
ST_VER_Handle ST_initVersion(void *pMemory, const size_t numBytes)
Initializes the SpinTAC Version object.
int32_t Date