dlog_4ch_f.h
Go to the documentation of this file.
1 //#############################################################################
2 // $TI Release: MotorControl SDK v3.00.01.00 $
3 // $Release Date: Tue May 26 19:13:58 CDT 2020 $
4 // $Copyright:
5 // Copyright (C) 2017-2020 Texas Instruments Incorporated - http://www.ti.com/
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
9 // are met:
10 //
11 // Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 //
14 // Redistributions in binary form must reproduce the above copyright
15 // notice, this list of conditions and the following disclaimer in the
16 // documentation and/or other materials provided with the
17 // distribution.
18 //
19 // Neither the name of Texas Instruments Incorporated nor the names of
20 // its contributors may be used to endorse or promote products derived
21 // from this software without specific prior written permission.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // $
35 //#############################################################################
36 
37 //----------------------------------------------------------------------------------
38 // FILE: dlog_4ch_f.h
39 //
40 // Description:header file for data logging module
41 //
42 // Version: 1.0
43 //
44 //----------------------------------------------------------------------------------
45 
46 #ifndef DLOG_4CH_F_H
47 #define DLOG_4CH_F_H
48 
49 #include "device.h"
50 
51 //*********** Structure Definition ********//
52 typedef struct{
63  int16_t status;
64  int16_t pre_scalar;
65  int16_t skip_count;
66  int16_t size;
67  int16_t count;
68 }DLOG_4CH_F;
69 
70 //*********** Function Declarations *******//
73 
74 //*********** Macro Definition ***********//
75 #define DLOG_4CH_F_MACRO(v) \
76  switch(v.status) \
77  { \
78  case 1: /* wait for trigger*/ \
79  if(*v.input_ptr1>v.trig_value && v.prev_value<v.trig_value) \
80  { \
81  /* rising edge detected start logging data*/ \
82  v.status=2; \
83  } \
84  break; \
85  case 2: \
86  v.skip_count++; \
87  if(v.skip_count==v.pre_scalar) \
88  { \
89  v.skip_count=0; \
90  v.output_ptr1[v.count]=*v.input_ptr1; \
91  v.output_ptr2[v.count]=*v.input_ptr2; \
92  v.output_ptr3[v.count]=*v.input_ptr3; \
93  v.output_ptr4[v.count]=*v.input_ptr4; \
94  v.count++; \
95  if(v.count==v.size) \
96  { \
97  v.count=0; \
98  v.status=1; \
99  } \
100  } \
101  break; \
102  default: \
103  v.status=0; \
104  } \
105  v.prev_value=*v.input_ptr1; \
106 
107 
108 #endif /* DLOG_4CH_F_H_ */
DLOG_4CH_F::output_ptr3
float32_t * output_ptr3
Definition: dlog_4ch_f.h:59
float32_t
float float32_t
Definition: sfra_f32.h:42
DLOG_4CH_F::output_ptr2
float32_t * output_ptr2
Definition: dlog_4ch_f.h:58
DLOG_4CH_F::count
int16_t count
Definition: dlog_4ch_f.h:67
DLOG_4CH_F::input_ptr1
float32_t * input_ptr1
Definition: dlog_4ch_f.h:53
DLOG_4CH_F_FUNC
void DLOG_4CH_F_FUNC(DLOG_4CH_F *v)
DLOG_4CH_F::output_ptr4
float32_t * output_ptr4
Definition: dlog_4ch_f.h:60
DLOG_4CH_F::size
int16_t size
Definition: dlog_4ch_f.h:66
device.h
DLOG_4CH_F::output_ptr1
float32_t * output_ptr1
Definition: dlog_4ch_f.h:57
DLOG_4CH_F::trig_value
float32_t trig_value
Definition: dlog_4ch_f.h:62
DLOG_4CH_F
Definition: dlog_4ch_f.h:52
DLOG_4CH_F::input_ptr4
float32_t * input_ptr4
Definition: dlog_4ch_f.h:56
DLOG_4CH_F::input_ptr2
float32_t * input_ptr2
Definition: dlog_4ch_f.h:54
DLOG_4CH_F::skip_count
int16_t skip_count
Definition: dlog_4ch_f.h:65
DLOG_4CH_F::pre_scalar
int16_t pre_scalar
Definition: dlog_4ch_f.h:64
DLOG_4CH_F::input_ptr3
float32_t * input_ptr3
Definition: dlog_4ch_f.h:55
DLOG_4CH_F_init
void DLOG_4CH_F_init(DLOG_4CH_F *v)
DLOG_4CH_F::prev_value
float32_t prev_value
Definition: dlog_4ch_f.h:61
DLOG_4CH_F::status
int16_t status
Definition: dlog_4ch_f.h:63

Copyright 2023, Texas Instruments Incorporated