MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

vib_comp.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2 * Copyright (c) 2015, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * --/COPYRIGHT--*/
32 #ifndef _VIB_COMP_H_
33 #define _VIB_COMP_H_
34
40
45
46
47 // Include the algorithm overview defined in modules/<module>/docs/doxygen/doxygen.h
49
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 // the includes
56
57 #include "sw/modules/iqmath/src/32b/IQmathLib.h"
58 #include "sw/modules/types/src/types.h"
59
60 // the typedefs
61
64 typedef struct _VIB_COMP_Obj_ *VIB_COMP_Handle;
65
66
67 // **************************************************************************
68 // the function prototypes
69
70
71 extern int16_t VIB_COMP_getAdvIndexDelta(VIB_COMP_Handle handle);
72
73 extern _iq VIB_COMP_getAlpha(VIB_COMP_Handle handle);
74
75 extern bool VIB_COMP_getFlag_enableOutput(VIB_COMP_Handle handle);
76
77 extern bool VIB_COMP_getFlag_enableUpdates(VIB_COMP_Handle handle);
78
79 extern int16_t VIB_COMP_getIndex(VIB_COMP_Handle handle);
80
83 extern size_t VIB_COMP_getSizeOfObject(void);
84
89 extern VIB_COMP_Handle VIB_COMP_init(void *pMemory,const size_t numBytes);
90
93 extern void VIB_COMP_reset(VIB_COMP_Handle handle);
94
100 extern _iq VIB_COMP_run(VIB_COMP_Handle handle,const _iq angle_mech_pu,const _iq Iq_in_pu);
101
102 extern void VIB_COMP_setAdvIndexDelta(VIB_COMP_Handle handle,const int16_t adv_index_delta);
103
104 extern void VIB_COMP_setAlpha(VIB_COMP_Handle handle,const _iq alpha);
105
106 extern void VIB_COMP_setFlag_enableOutput(VIB_COMP_Handle handle,const bool state);
107
108 extern void VIB_COMP_setFlag_enableUpdates(VIB_COMP_Handle handle,const bool state);
109
110 extern void VIB_COMP_setIndex(VIB_COMP_Handle handle,const int16_t index);
111
112 extern void VIB_COMP_setParams(VIB_COMP_Handle handle,const _iq alpha,const int16_t adv_index_delta);
113
114
115 #ifdef __cplusplus
116 }
117 #endif // extern "C"
118
120 #endif // end of _VIB_COMP_H_ definition
121
types.h
Contains the public interface to the types definitions.
VIB_COMP_getIndex
int16_t VIB_COMP_getIndex(VIB_COMP_Handle handle)
VIB_COMP_reset
void VIB_COMP_reset(VIB_COMP_Handle handle)
Resets the vibration compensation module.
_iq
long _iq
Definition: 32b/IQmathLib.h:223
VIB_COMP_setFlag_enableUpdates
void VIB_COMP_setFlag_enableUpdates(VIB_COMP_Handle handle, const bool state)
VIB_COMP_getFlag_enableUpdates
bool VIB_COMP_getFlag_enableUpdates(VIB_COMP_Handle handle)
VIB_COMP_getAdvIndexDelta
int16_t VIB_COMP_getAdvIndexDelta(VIB_COMP_Handle handle)
VIB_COMP_setAlpha
void VIB_COMP_setAlpha(VIB_COMP_Handle handle, const _iq alpha)
VIB_COMP_setAdvIndexDelta
void VIB_COMP_setAdvIndexDelta(VIB_COMP_Handle handle, const int16_t adv_index_delta)
VIB_COMP_getFlag_enableOutput
bool VIB_COMP_getFlag_enableOutput(VIB_COMP_Handle handle)
VIB_COMP_setIndex
void VIB_COMP_setIndex(VIB_COMP_Handle handle, const int16_t index)
VIB_COMP_getSizeOfObject
size_t VIB_COMP_getSizeOfObject(void)
Gets the size of the vibration compensation module in 16 bit words.
VIB_COMP_init
VIB_COMP_Handle VIB_COMP_init(void *pMemory, const size_t numBytes)
Initializes the vibration compensation module.
VIB_COMP_Handle
struct _VIB_COMP_Obj_ * VIB_COMP_Handle
Defines the VIB_COMP handle.
Definition: vib_comp.h:64
VIB_COMP_run
_iq VIB_COMP_run(VIB_COMP_Handle handle, const _iq angle_mech_pu, const _iq Iq_in_pu)
Runs the vibration compensation algorithm.
IQmathLib.h
VIB_COMP_setParams
void VIB_COMP_setParams(VIB_COMP_Handle handle, const _iq alpha, const int16_t adv_index_delta)
VIB_COMP_getAlpha
_iq VIB_COMP_getAlpha(VIB_COMP_Handle handle)
VIB_COMP_setFlag_enableOutput
void VIB_COMP_setFlag_enableOutput(VIB_COMP_Handle handle, const bool state)