F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
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
71typedef U32 FwDpIdType;
72#define PRI_FwDpIdType PRIu32
73
74typedef U32 FwDpPriorityType;
75#define PRI_FwDpPriorityType PRIu32
76
77// Boolean values for serialization
78#ifndef FW_SERIALIZE_TRUE_VALUE
79#define FW_SERIALIZE_TRUE_VALUE (0xFF)
80#endif
81
82#ifndef FW_SERIALIZE_FALSE_VALUE
83#define FW_SERIALIZE_FALSE_VALUE (0x00)
84#endif
85
86// Allow objects to have names. Allocates storage for each instance
87#ifndef FW_OBJECT_NAMES
88#define FW_OBJECT_NAMES \
89 1
90#endif
91
92// To reduce binary size, FW_OPTIONAL_NAME(<string>) can be used to substitute strings with an empty string
93// when running with FW_OBJECT_NAMES disabled
94#if FW_OBJECT_NAMES == 1
95#define FW_OPTIONAL_NAME(name) name
96#else
97#define FW_OPTIONAL_NAME(name) ""
98#endif
99
100// Add methods to query an object about its name. Can be overridden by derived classes
101// For FW_OBJECT_TO_STRING to work, FW_OBJECT_NAMES must be enabled
102#if FW_OBJECT_NAMES == 1
103#ifndef FW_OBJECT_TO_STRING
104#define FW_OBJECT_TO_STRING \
105 1
106#endif
107#else
108#define FW_OBJECT_TO_STRING 0
109#endif
110
111// Adds the ability for all component related objects to register
112// centrally.
113#ifndef FW_OBJECT_REGISTRATION
114#define FW_OBJECT_REGISTRATION \
115 1
116#endif
117
118#ifndef FW_QUEUE_REGISTRATION
119#define FW_QUEUE_REGISTRATION 1
120#endif
121
122#ifndef FW_BAREMETAL_SCHEDULER
123#define FW_BAREMETAL_SCHEDULER \
124 0
125#endif
126
127// Port Facilities
128
129// This allows tracing calls through ports for debugging
130#ifndef FW_PORT_TRACING
131#define FW_PORT_TRACING 1
132#endif
133
134// This generates code to connect to serialized ports
135#ifndef FW_PORT_SERIALIZATION
136#define FW_PORT_SERIALIZATION \
137 1
139#endif
140
141// Component Facilities
142
143// Serialization
144
145// Add a type id when serialization is done. More storage,
146// but better detection of errors
147// TODO: Not working yet
148
149#ifndef FW_SERIALIZATION_TYPE_ID
150#define FW_SERIALIZATION_TYPE_ID \
151 0
152#endif
153
154// Number of bytes to use for serialization IDs. More
155// bytes is more storage, but greater number of IDs
156#if FW_SERIALIZATION_TYPE_ID
157#ifndef FW_SERIALIZATION_TYPE_ID_BYTES
158#define FW_SERIALIZATION_TYPE_ID_BYTES 4
159#endif
160#endif
161
162// Set assertion form. Options:
163// 1. FW_NO_ASSERT: assertions are compiled out, side effects are kept
164// 2. FW_FILEID_ASSERT: asserts report a file CRC and line number
165// 3. FW_FILENAME_ASSERT: asserts report a file path (__FILE__) and line number
166// 4. FW_RELATIVE_PATH_ASSERT: asserts report a relative path within F´ or F´ library and line number
167//
168// Note: users who want alternate asserts should set assert level to FW_NO_ASSERT and define FW_ASSERT in this header
169#define FW_ASSERT_DFL_MSG_LEN 256
170#ifndef FW_ASSERT_LEVEL
171#define FW_ASSERT_LEVEL FW_FILENAME_ASSERT
172#endif
173
174// Define max length of assert string
175#ifndef FW_ASSERT_TEXT_SIZE
176#define FW_ASSERT_TEXT_SIZE 120
177#endif
178
179// Adjust various configuration parameters in the architecture. Some of the above enables may disable some of the values
180
181// The size of the object name stored in the object base class. Larger names will be truncated.
182#if FW_OBJECT_NAMES
183#ifndef FW_OBJ_NAME_MAX_SIZE
184#define FW_OBJ_NAME_MAX_SIZE \
185 80
186#endif
187#endif
188
189// When querying an object as to an object-specific description, this specifies the size of the buffer to store the
190// description.
191#if FW_OBJECT_TO_STRING
192#ifndef FW_OBJ_TO_STRING_BUFFER_SIZE
193#define FW_OBJ_TO_STRING_BUFFER_SIZE 255
194#endif
195#endif
196
197#if FW_OBJECT_REGISTRATION
198// For the simple object registry provided with the framework, this specifies how many objects the registry will store.
199#ifndef FW_OBJ_SIMPLE_REG_ENTRIES
200#define FW_OBJ_SIMPLE_REG_ENTRIES 500
201#endif
202// When dumping the contents of the registry, this specifies the size of the buffer used to store object names. Should
203// be >= FW_OBJ_NAME_MAX_SIZE.
204#ifndef FW_OBJ_SIMPLE_REG_BUFF_SIZE
205#define FW_OBJ_SIMPLE_REG_BUFF_SIZE 255
206#endif
207#endif
208
209#if FW_QUEUE_REGISTRATION
210// For the simple queue registry provided with the framework, this specifies how many queues the registry will store.
211#ifndef FW_QUEUE_SIMPLE_QUEUE_ENTRIES
212#define FW_QUEUE_SIMPLE_QUEUE_ENTRIES 100
213#endif
214#endif
215
216// Specifies the size of the string holding the queue name for queues
217#ifndef FW_QUEUE_NAME_MAX_SIZE
218#define FW_QUEUE_NAME_MAX_SIZE 80
219#endif
220
221// Specifies the size of the string holding the task name for active components and tasks
222#ifndef FW_TASK_NAME_MAX_SIZE
223#define FW_TASK_NAME_MAX_SIZE 80
224#endif
225
226// Specifies the size of the buffer that contains a communications packet.
227#ifndef FW_COM_BUFFER_MAX_SIZE
228#define FW_COM_BUFFER_MAX_SIZE 128
229#endif
230
231// Specifies the size of the buffer that contains the serialized command arguments.
232
233#ifndef FW_CMD_ARG_BUFFER_MAX_SIZE
234#define FW_CMD_ARG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwOpcodeType) - sizeof(FwPacketDescriptorType))
235#endif
236
237// Specifies the maximum size of a string in a command argument
238#ifndef FW_CMD_STRING_MAX_SIZE
239#define FW_CMD_STRING_MAX_SIZE 40
240#endif
241
242// Normally when a command is deserialized, the handler checks to see if there are any leftover
243// bytes in the buffer. If there are, it assumes that the command was corrupted somehow since
244// the serialized size should match the serialized size of the argument list. In some cases,
245// command buffers are padded so the data can be larger than the serialized size of the command.
246// Setting the below to zero will disable the check at the cost of not detecting commands that
247// are too large.
248#ifndef FW_CMD_CHECK_RESIDUAL
249#define FW_CMD_CHECK_RESIDUAL 1
250#endif
251
252// Specifies the size of the buffer that contains the serialized log arguments.
253#ifndef FW_LOG_BUFFER_MAX_SIZE
254#define FW_LOG_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwEventIdType) - sizeof(FwPacketDescriptorType))
255#endif
256
257// Specifies the maximum size of a string in a log event
258#ifndef FW_LOG_STRING_MAX_SIZE
259#define FW_LOG_STRING_MAX_SIZE 100
260#endif
261
262// Specifies the size of the buffer that contains the serialized telemetry value.
263#ifndef FW_TLM_BUFFER_MAX_SIZE
264#define FW_TLM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwChanIdType) - sizeof(FwPacketDescriptorType))
265#endif
266
267// Specifies the maximum size of a string in a telemetry channel
268#ifndef FW_TLM_STRING_MAX_SIZE
269#define FW_TLM_STRING_MAX_SIZE 40
270#endif
271
272// Specifies the size of the buffer that contains the serialized parameter value.
273#ifndef FW_PARAM_BUFFER_MAX_SIZE
274#define FW_PARAM_BUFFER_MAX_SIZE (FW_COM_BUFFER_MAX_SIZE - sizeof(FwPrmIdType) - sizeof(FwPacketDescriptorType))
275#endif
276
277// Specifies the maximum size of a string in a parameter
278#ifndef FW_PARAM_STRING_MAX_SIZE
279#define FW_PARAM_STRING_MAX_SIZE 40
280#endif
281
282// Specifies the maximum size of a file upload chunk
283#ifndef FW_FILE_BUFFER_MAX_SIZE
284#define FW_FILE_BUFFER_MAX_SIZE 255
285#endif
286
287// Specifies the maximum size of a string in an interface call
288#ifndef FW_INTERNAL_INTERFACE_STRING_MAX_SIZE
289#define FW_INTERNAL_INTERFACE_STRING_MAX_SIZE 256
290#endif
291
292// enables text logging of events as well as data logging. Adds a second logging port for text output.
293#ifndef FW_ENABLE_TEXT_LOGGING
294#define FW_ENABLE_TEXT_LOGGING 1
295#endif
296
297// Define the size of the text log string buffer. Should be large enough for format string and arguments
298#ifndef FW_LOG_TEXT_BUFFER_SIZE
299#define FW_LOG_TEXT_BUFFER_SIZE 256
300#endif
301
302// Define if serializables have toString() method. Turning off will save code space and
303// string constants. Must be enabled if text logging enabled
304#ifndef FW_SERIALIZABLE_TO_STRING
305#define FW_SERIALIZABLE_TO_STRING 1
306#endif
307
308#if FW_SERIALIZABLE_TO_STRING
309#ifndef FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE
310#define FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE 255
311#endif
312#endif
313
314// Define if arrays have toString() method.
315#ifndef FW_ARRAY_TO_STRING
316#define FW_ARRAY_TO_STRING 1
317#endif
318
319#if FW_ARRAY_TO_STRING
320#ifndef FW_ARRAY_TO_STRING_BUFFER_SIZE
321#define FW_ARRAY_TO_STRING_BUFFER_SIZE 256
322#endif
323#endif
324
325// Some settings to enable AMPCS compatibility. This breaks regular ISF GUI compatibility
326#ifndef FW_AMPCS_COMPATIBLE
327#define FW_AMPCS_COMPATIBLE 0
328#endif
329
330// These settings configure whether or not the timebase and context values for the Fw::Time
331// class are used. Some systems may not use or need those fields
332
333#ifndef FW_USE_TIME_BASE
334#define FW_USE_TIME_BASE 1
335#endif
336
337#ifndef FW_USE_TIME_CONTEXT
338#define FW_USE_TIME_CONTEXT 1
339#endif
340//
341// These defines used for the FilepathCharString type
342
343#ifndef FW_FIXED_LENGTH_STRING_SIZE
344#define FW_FIXED_LENGTH_STRING_SIZE 256
345#endif
346
347// *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have
348// the type definitions in Fw/Types/BasicTypes available.
349
350#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 FwDpPriorityType
Definition FpConfig.h:74
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwEventIdType
Definition FpConfig.h:62
U32 FwDpIdType
Definition FpConfig.h:71
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