1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
//*****************************************************************************
//
// qs-logger.h - Defines data types used in the data logger application.
//
// Copyright (c) 2011-2014 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 2.1.0.12573 of the EK-LM4F232 Firmware Package.
//
//*****************************************************************************
#ifndef __QS_LOGGER_H__
#define __QS_LOGGER_H__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
// The following defines the order of data items to log. It must match the
// order that they appear in the "CHANNELS" menu (see menus.c), and also
// the order they are stored in the ADC data buffer (see acquire.c).
//
//*****************************************************************************
#define LOG_ITEM_USER0 0
#define LOG_ITEM_USER1 1
#define LOG_ITEM_USER2 2
#define LOG_ITEM_USER3 3
#define LOG_ITEM_ACCELX 4
#define LOG_ITEM_ACCELY 5
#define LOG_ITEM_ACCELZ 6
#define LOG_ITEM_EXTTEMP 7
#define LOG_ITEM_INTTEMP 8
#define LOG_ITEM_CURRENT 9
#define NUM_LOG_ITEMS 10
//*****************************************************************************
//
// These are additional definitions of items that may be displayed on the
// screen that are not acquired data. These are used for updating dynamic
// text screens on the display.
//
//*****************************************************************************
#define TEXT_ITEM_STATUS1 10
#define TEXT_ITEM_STATUS2 11
#define TEXT_ITEM_STATUS3 12
#define TEXT_ITEM_STATUS_TITLE 13
#define TEXT_ITEM_DATE 14
#define TEXT_ITEM_TIME 15
#define NUM_TEXT_ITEMS 16
//*****************************************************************************
//
// A structure that defines a data record. This is the binary format of the
// acquired data that will be stored.
//
//*****************************************************************************
typedef struct
{
uint32_t ui32Seconds; // 32 bits of seconds
uint16_t ui16Subseconds; // 15 bits of subseconds
uint16_t ui16ItemMask; // 16 bits means maximum 16 items
int16_t pi16Items[];
}
tLogRecord;
//*****************************************************************************
//
// This structure defines a container to hold the state of all the
// configuration items. It is used both for passing configuration
// between modules and for persistent storage of the configuration.
//
//*****************************************************************************
typedef struct
{
//
// A value used to identify this structure
//
uint32_t ui32Cookie;
//
// A flag to indicate if the data logger is current logging data
// using the sleep mode. The data logger uses this to determine if
// it needs to continue taking samples once it wakes from hibernate.
// This is a 32-bit type just to keep the entire struct 32-bit aligned.
//
uint32_t ui32SleepLogging;
//
// The period for sampling data. It is stored as a 24.8 seconds.frac
// format. The lower 8 bits represent power-of-2 fractional seconds
// with a resolution of 1/128 seconds (only lower 7 bits are used).
//
uint32_t ui32Period;
//
// Saved location for writing records to flash.
//
uint32_t ui32FlashStore;
//
// The name of the USB file currently opened for logging
//
char pcFilename[8];
//
// The bit mask of the channels selected for logging.
//
uint16_t ui16SelectedMask;
//
// A flag indicating whether the data logger should sleep between samples.
//
bool bSleep;
//
// A value that is used to select the storage medium.
//
uint8_t ui8Storage;
//
// A checksum for the structure
//
uint32_t ui32Crc16;
}
tConfigState;
#define STATE_COOKIE 0x0355AAC0
//*****************************************************************************
//
// The values indicating which storage medium is to be used for logging data.
//
//*****************************************************************************
#define CONFIG_STORAGE_NONE 0
#define CONFIG_STORAGE_USB 1
#define CONFIG_STORAGE_HOSTPC 2
#define CONFIG_STORAGE_FLASH 3
#define CONFIG_STORAGE_VIEWER 4
#define CONFIG_STORAGE_CHOICES 5
//*****************************************************************************
//
// Function prototypes.
//
//*****************************************************************************
extern void SetStatusText(const char *pcTitle, const char *pcLine1,
const char *pcLine2, const char *pcLine3);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __QS_LOGGER_H__
|