F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
FpConfig.h
Go to the documentation of this file.
1
11#include <Fw/Types/BasicTypes.h>
12#ifndef FPCONFIG_H_
13#define FPCONFIG_H_
14
16#define PRI_FwIndexType PRI_PlatformIndexType
17
19#define PRI_FwSizeType PRI_PlatformSizeType
20
22#define PRI_FwAssertArgType PRI_PlatformAssertArgType
23
25#define PRI_FwNativeIntType PRI_PlatformIntType
26
28#define PRI_FwNativeUIntType PRI_PlatformUIntType
29
30typedef U16 FwBuffSizeType;
31#define PRI_FwBuffSizeType PRIu16
32
33typedef I32 FwEnumStoreType;
34#define PRI_FwEnumStoreType PRId32
35
36// Define enumeration for Time base types
37// Note: maintaining C-style
38typedef enum {
43 0xFFFF
45#define FW_CONTEXT_DONT_CARE 0xFF
46
48#define PRI_FwTimeBaseStoreType PRIu16
49
51#define PRI_FwTimeContextStoreType PRIu8
52
54#define PRI_FwPacketDescriptorType PRIu32
55
56typedef U32 FwOpcodeType;
57#define PRI_FwOpcodeType PRIu32
58
59typedef U32 FwChanIdType;
60#define PRI_FwChanIdType PRIu32
61
62typedef U32 FwEventIdType;
63#define PRI_FwEventIdType PRIu32
64
65typedef U32 FwPrmIdType;
66#define PRI_FwPrmIdType PRIu32
67
69#define PRI_FwTlmPacketizeIdType PRIu16
70
71// Boolean values for serialization
72#ifndef FW_SERIALIZE_TRUE_VALUE
73#define FW_SERIALIZE_TRUE_VALUE (0xFF)
74#endif
75
76#ifndef FW_SERIALIZE_FALSE_VALUE
77#define FW_SERIALIZE_FALSE_VALUE (0x00)
78#endif
79
80// Allow objects to have names. Allocates storage for each instance
81#ifndef FW_OBJECT_NAMES
82#define FW_OBJECT_NAMES \
83 1
84#endif
85
86// To reduce binary size, FW_OPTIONAL_NAME(<string>) can be used to substitute strings with an empty string
87// when running with FW_OBJECT_NAMES disabled
88#if FW_OBJECT_NAMES == 1
89#define FW_OPTIONAL_NAME(name) name
90#else
91#define FW_OPTIONAL_NAME(name) ""
92#endif
93
94// Add methods to query an object about its name. Can be overridden by derived classes
95// For FW_OBJECT_TO_STRING to work, FW_OBJECT_NAMES must be enabled
96#if FW_OBJECT_NAMES == 1
97#ifndef FW_OBJECT_TO_STRING
98#define FW_OBJECT_TO_STRING \
99 1
100#endif
101#else
102#define FW_OBJECT_TO_STRING 0
103#endif
104
105// Adds the ability for all component related objects to register
106// centrally.
107#ifndef FW_OBJECT_REGISTRATION
108#define FW_OBJECT_REGISTRATION \
109 1
110#endif
111
112#ifndef FW_QUEUE_REGISTRATION
113#define FW_QUEUE_REGISTRATION 1
114#endif
115
116#ifndef FW_BAREMETAL_SCHEDULER
117#define FW_BAREMETAL_SCHEDULER \
118 0
119#endif
120
121// Port Facilities
122
123// This allows tracing calls through ports for debugging
124#ifndef FW_PORT_TRACING
125#define FW_PORT_TRACING 1
126#endif
127
128// This generates code to connect to serialized ports
129#ifndef FW_PORT_SERIALIZATION
130#define FW_PORT_SERIALIZATION \
131 1
133#endif
134
135// Component Facilities
136
137// Serialization
138
139// Add a type id when serialization is done. More storage,
140// but better detection of errors
141// TODO: Not working yet
142
143#ifndef FW_SERIALIZATION_TYPE_ID
144#define FW_SERIALIZATION_TYPE_ID \
145 0
146#endif
147
148// Number of bytes to use for serialization IDs. More
149// bytes is more storage, but greater number of IDs
150#if FW_SERIALIZATION_TYPE_ID
151#ifndef FW_SERIALIZATION_TYPE_ID_BYTES
152#define FW_SERIALIZATION_TYPE_ID_BYTES 4
153#endif
154#endif
155
156// Set assertion form. Options:
157// 1. FW_NO_ASSERT: assertions are compiled out
158// 2. FW_FILEID_ASSERT: asserts report a file CRC and line number
159// 3. FW_FILENAME_ASSERT: asserts report a file path (__FILE__) and line number
160// 4. FW_RELATIVE_PATH_ASSERT: asserts report a relative path within F´ or F´ library and line number
161#define FW_ASSERT_DFL_MSG_LEN 256
162#ifndef FW_ASSERT_LEVEL
163#define FW_ASSERT_LEVEL FW_FILENAME_ASSERT
164#endif
165
166// Define max length of assert string
167#ifndef FW_ASSERT_TEXT_SIZE
168#define FW_ASSERT_TEXT_SIZE 120
169#endif
170
171// Adjust various configuration parameters in the architecture. Some of the above enables may disable some of the values
172
173// The size of the object name stored in the object base class. Larger names will be truncated.
174#if FW_OBJECT_NAMES
175#ifndef FW_OBJ_NAME_MAX_SIZE
176#define FW_OBJ_NAME_MAX_SIZE \
177 80
178#endif
179#endif
180
181// When querying an object as to an object-specific description, this specifies the size of the buffer to store the
182// description.
183#if FW_OBJECT_TO_STRING
184#ifndef FW_OBJ_TO_STRING_BUFFER_SIZE
185#define FW_OBJ_TO_STRING_BUFFER_SIZE 255
186#endif
187#endif
188
189#if FW_OBJECT_REGISTRATION
190// For the simple object registry provided with the framework, this specifies how many objects the registry will store.
191#ifndef FW_OBJ_SIMPLE_REG_ENTRIES
192#define FW_OBJ_SIMPLE_REG_ENTRIES 500
193#endif
194// When dumping the contents of the registry, this specifies the size of the buffer used to store object names. Should
195// be >= FW_OBJ_NAME_MAX_SIZE.
196#ifndef FW_OBJ_SIMPLE_REG_BUFF_SIZE
197#define FW_OBJ_SIMPLE_REG_BUFF_SIZE 255
198#endif
199#endif
200
201#if FW_QUEUE_REGISTRATION
202// For the simple queue registry provided with the framework, this specifies how many queues the registry will store.
203#ifndef FW_QUEUE_SIMPLE_QUEUE_ENTRIES
204#define FW_QUEUE_SIMPLE_QUEUE_ENTRIES 100
205#endif
206#endif
207
208// Specifies the size of the string holding the queue name for queues
209#ifndef FW_QUEUE_NAME_MAX_SIZE
210#define FW_QUEUE_NAME_MAX_SIZE 80
211#endif
212
213// Specifies the size of the string holding the task name for active components and tasks
214#ifndef FW_TASK_NAME_MAX_SIZE
215#define FW_TASK_NAME_MAX_SIZE 80
216#endif
217
218// Specifies the size of the buffer that contains a communications packet.
219#ifndef FW_COM_BUFFER_MAX_SIZE
220#define FW_COM_BUFFER_MAX_SIZE 128
221#endif
222
223// Specifies the size of the buffer that contains the serialized command arguments.
224
225#ifndef FW_CMD_ARG_BUFFER_MAX_SIZE
226#define FW_CMD_ARG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwOpcodeType) - sizeof(FwPacketDescriptorType))
227#endif
228
229// Specifies the maximum size of a string in a command argument
230#ifndef FW_CMD_STRING_MAX_SIZE
231#define FW_CMD_STRING_MAX_SIZE 40
232#endif
233
234// Normally when a command is deserialized, the handler checks to see if there are any leftover
235// bytes in the buffer. If there are, it assumes that the command was corrupted somehow since
236// the serialized size should match the serialized size of the argument list. In some cases,
237// command buffers are padded so the data can be larger than the serialized size of the command.
238// Setting the below to zero will disable the check at the cost of not detecting commands that
239// are too large.
240#ifndef FW_CMD_CHECK_RESIDUAL
241#define FW_CMD_CHECK_RESIDUAL 1
242#endif
243
244// Specifies the size of the buffer that contains the serialized log arguments.
245#ifndef FW_LOG_BUFFER_MAX_SIZE
246#define FW_LOG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwEventIdType) - sizeof(FwPacketDescriptorType))
247#endif
248
249// Specifies the maximum size of a string in a log event
250#ifndef FW_LOG_STRING_MAX_SIZE
251#define FW_LOG_STRING_MAX_SIZE 100
252#endif
253
254// Specifies the size of the buffer that contains the serialized telemetry value.
255#ifndef FW_TLM_BUFFER_MAX_SIZE
256#define FW_TLM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwChanIdType) - sizeof(FwPacketDescriptorType))
257#endif
258
259// Specifies the maximum size of a string in a telemetry channel
260#ifndef FW_TLM_STRING_MAX_SIZE
261#define FW_TLM_STRING_MAX_SIZE 40
262#endif
263
264// Specifies the size of the buffer that contains the serialized parameter value.
265#ifndef FW_PARAM_BUFFER_MAX_SIZE
266#define FW_PARAM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwPrmIdType) - sizeof(FwPacketDescriptorType))
267#endif
268
269// Specifies the maximum size of a string in a parameter
270#ifndef FW_PARAM_STRING_MAX_SIZE
271#define FW_PARAM_STRING_MAX_SIZE 40
272#endif
273
274// Specifies the maximum size of a file upload chunk
275#ifndef FW_FILE_BUFFER_MAX_SIZE
276#define FW_FILE_BUFFER_MAX_SIZE 255
277#endif
278
279// Specifies the maximum size of a string in an interface call
280#ifndef FW_INTERNAL_INTERFACE_STRING_MAX_SIZE
281#define FW_INTERNAL_INTERFACE_STRING_MAX_SIZE 256
282#endif
283
284// enables text logging of events as well as data logging. Adds a second logging port for text output.
285#ifndef FW_ENABLE_TEXT_LOGGING
286#define FW_ENABLE_TEXT_LOGGING 1
287#endif
288
289// Define the size of the text log string buffer. Should be large enough for format string and arguments
290#ifndef FW_LOG_TEXT_BUFFER_SIZE
291#define FW_LOG_TEXT_BUFFER_SIZE 256
292#endif
293
294// Define if serializables have toString() method. Turning off will save code space and
295// string constants. Must be enabled if text logging enabled
296#ifndef FW_SERIALIZABLE_TO_STRING
297#define FW_SERIALIZABLE_TO_STRING 1
298#endif
299
300#if FW_SERIALIZABLE_TO_STRING
301#ifndef FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE
302#define FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE 255
303#endif
304#endif
305
306// Define if arrays have toString() method.
307#ifndef FW_ARRAY_TO_STRING
308#define FW_ARRAY_TO_STRING 1
309#endif
310
311#if FW_ARRAY_TO_STRING
312#ifndef FW_ARRAY_TO_STRING_BUFFER_SIZE
313#define FW_ARRAY_TO_STRING_BUFFER_SIZE 256
314#endif
315#endif
316
317// Some settings to enable AMPCS compatibility. This breaks regular ISF GUI compatibility
318#ifndef FW_AMPCS_COMPATIBLE
319#define FW_AMPCS_COMPATIBLE 0
320#endif
321
322// These settings configure whether or not the timebase and context values for the Fw::Time
323// class are used. Some systems may not use or need those fields
324
325#ifndef FW_USE_TIME_BASE
326#define FW_USE_TIME_BASE 1
327#endif
328
329#ifndef FW_USE_TIME_CONTEXT
330#define FW_USE_TIME_CONTEXT 1
331#endif
332//
333// These defines used for the FilepathCharString type
334
335#ifndef FW_FIXED_LENGTH_STRING_SIZE
336#define FW_FIXED_LENGTH_STRING_SIZE 256
337#endif
338
339// *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have
340// the type definitions in Fw/Types/BasicTypes available.
341
342#endif
uint8_t U8
8-bit unsigned integer
Definition BasicTypes.h:26
PlatformIntType PlatformIndexType
unsigned int PlatformUIntType
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
PlatformIntType PlatformAssertArgType
PlatformUIntType PlatformSizeType
TimeBase
Definition FpConfig.h:38
@ TB_WORKSTATION_TIME
Time as reported on workstation where software is running. For testing.
Definition FpConfig.h:41
@ TB_DONT_CARE
Don't care value for sequences. If FwTimeBaseStoreType is changed, value should be changed.
Definition FpConfig.h:42
@ TB_PROC_TIME
Indicates time is processor cycle time. Not tied to external time.
Definition FpConfig.h:40
@ TB_NONE
No time base has been established.
Definition FpConfig.h:39
I32 FwEnumStoreType
Definition FpConfig.h:33
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:21
PlatformUIntType FwNativeUIntType
Definition FpConfig.h:27
PlatformIntType FwNativeIntType
Definition FpConfig.h:24
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwEventIdType
Definition FpConfig.h:62
U32 FwPacketDescriptorType
Definition FpConfig.h:53
U16 FwTlmPacketizeIdType
Definition FpConfig.h:68
U16 FwTimeBaseStoreType
Definition FpConfig.h:47
U32 FwOpcodeType
Definition FpConfig.h:56
U8 FwTimeContextStoreType
Definition FpConfig.h:50
PlatformSizeType FwSizeType
Definition FpConfig.h:18
U32 FwPrmIdType
Definition FpConfig.h:65
PlatformIndexType FwIndexType
Definition FpConfig.h:15
U16 FwBuffSizeType
Definition FpConfig.h:30