1 /*******************************************************************************
\r
2 * (c) Copyright 2009 Actel Corporation. All rights reserved.
\r
4 * SVN $Revision: 2841 $
\r
5 * SVN $Date: 2010-07-20 18:10:00 +0100 (Tue, 20 Jul 2010) $
\r
8 /*=========================================================================*//**
\r
9 @mainpage ACE Configurator data provided to ACE Driver.
\r
11 @section intro_sec Introduction
\r
12 This file contains the definition of data structures used by the ACE
\r
13 Configurator software tool for sharing information about the ACE configuration
\r
14 with the ACE driver. It also contains the API for accessor functions used by
\r
15 the ACE driver to extract relevant information from these data structures.
\r
16 *//*=========================================================================*/
\r
17 #ifndef __MSS_ACE_CONFIGURATOR_H_
\r
18 #define __MSS_ACE_CONFIGURATOR_H_
\r
20 #include "mss_ace.h"
\r
26 /*-------------------------------------------------------------------------*//**
\r
27 Post Processing Engine (PPE) flags IDs.
\r
105 PPE_FLAGS2_10 = 74,
\r
106 PPE_FLAGS2_11 = 75,
\r
107 PPE_FLAGS2_12 = 76,
\r
108 PPE_FLAGS2_13 = 77,
\r
109 PPE_FLAGS2_14 = 78,
\r
110 PPE_FLAGS2_15 = 79,
\r
111 PPE_FLAGS2_16 = 80,
\r
112 PPE_FLAGS2_17 = 81,
\r
113 PPE_FLAGS2_18 = 82,
\r
114 PPE_FLAGS2_19 = 83,
\r
115 PPE_FLAGS2_20 = 84,
\r
116 PPE_FLAGS2_21 = 85,
\r
117 PPE_FLAGS2_22 = 86,
\r
118 PPE_FLAGS2_23 = 87,
\r
119 PPE_FLAGS2_24 = 88,
\r
120 PPE_FLAGS2_25 = 89,
\r
121 PPE_FLAGS2_26 = 90,
\r
122 PPE_FLAGS2_27 = 91,
\r
123 PPE_FLAGS2_28 = 92,
\r
124 PPE_FLAGS2_29 = 93,
\r
125 PPE_FLAGS2_30 = 94,
\r
126 PPE_FLAGS2_31 = 95,
\r
131 PPE_FLAGS3_4 = 100,
\r
132 PPE_FLAGS3_5 = 101,
\r
133 PPE_FLAGS3_6 = 102,
\r
134 PPE_FLAGS3_7 = 103,
\r
135 PPE_FLAGS3_8 = 104,
\r
136 PPE_FLAGS3_9 = 105,
\r
137 PPE_FLAGS3_10 = 106,
\r
138 PPE_FLAGS3_11 = 107,
\r
139 PPE_FLAGS3_12 = 108,
\r
140 PPE_FLAGS3_13 = 109,
\r
141 PPE_FLAGS3_14 = 110,
\r
142 PPE_FLAGS3_15 = 111,
\r
143 PPE_FLAGS3_16 = 112,
\r
144 PPE_FLAGS3_17 = 113,
\r
145 PPE_FLAGS3_18 = 114,
\r
146 PPE_FLAGS3_19 = 115,
\r
147 PPE_FLAGS3_20 = 116,
\r
148 PPE_FLAGS3_21 = 117,
\r
149 PPE_FLAGS3_22 = 118,
\r
150 PPE_FLAGS3_23 = 119,
\r
151 PPE_FLAGS3_24 = 120,
\r
152 PPE_FLAGS3_25 = 121,
\r
153 PPE_FLAGS3_26 = 122,
\r
154 PPE_FLAGS3_27 = 123,
\r
155 PPE_FLAGS3_28 = 124,
\r
156 PPE_FLAGS3_29 = 125,
\r
157 PPE_FLAGS3_30 = 126,
\r
158 PPE_FLAGS3_31 = 127,
\r
159 PPE_SFFLAGS_0 = 128,
\r
160 PPE_SFFLAGS_1 = 129,
\r
161 PPE_SFFLAGS_2 = 130,
\r
162 PPE_SFFLAGS_3 = 131,
\r
163 PPE_SFFLAGS_4 = 132,
\r
164 PPE_SFFLAGS_5 = 133,
\r
165 PPE_SFFLAGS_6 = 134,
\r
166 PPE_SFFLAGS_7 = 135,
\r
167 PPE_SFFLAGS_8 = 136,
\r
168 PPE_SFFLAGS_9 = 137,
\r
169 PPE_SFFLAGS_10 = 138,
\r
170 PPE_SFFLAGS_11 = 139,
\r
171 PPE_SFFLAGS_12 = 140,
\r
172 PPE_SFFLAGS_13 = 141,
\r
173 PPE_SFFLAGS_14 = 142,
\r
174 PPE_SFFLAGS_15 = 143,
\r
175 PPE_SFFLAGS_16 = 144,
\r
176 PPE_SFFLAGS_17 = 145,
\r
177 PPE_SFFLAGS_18 = 146,
\r
178 PPE_SFFLAGS_19 = 147,
\r
179 PPE_SFFLAGS_20 = 148,
\r
180 PPE_SFFLAGS_21 = 149,
\r
181 PPE_SFFLAGS_22 = 150,
\r
182 PPE_SFFLAGS_23 = 151,
\r
183 PPE_SFFLAGS_24 = 152,
\r
184 PPE_SFFLAGS_25 = 153,
\r
185 PPE_SFFLAGS_26 = 154,
\r
186 PPE_SFFLAGS_27 = 155,
\r
187 PPE_SFFLAGS_28 = 156,
\r
188 PPE_SFFLAGS_29 = 157,
\r
189 PPE_SFFLAGS_30 = 158,
\r
190 PPE_SFFLAGS_31 = 159,
\r
191 NB_OF_PPE_FLAGS = 160
\r
194 /*-------------------------------------------------------------------------*//**
\r
196 The following defines are used to indicate the type of flag selected in the
\r
200 A flag configured as BASIC_THRESHOLD_OVER will be asserted when the value of
\r
201 the input channel exceeds the value of the flag threshold. The flag will be
\r
202 de-asserted once the value of the input channel falls back under the threshold
\r
203 value. No hysteresis or state filtering is applied to the flag.
\r
205 #define BASIC_THRESHOLD_OVER 0u
\r
208 A flag configured as BASIC_THRESHOLD_UNDER will be asserted when the value of
\r
209 the input channel falls under the value of the flag threshold. The flag will be
\r
210 de-asserted once the value of the input channel exceeds the threshold value.
\r
211 No hysteresis or state filtering is applied to the flag.
\r
213 #define BASIC_THRESHOLD_UNDER 1u
\r
216 A flag configured as STATE_FILTERED_OVER will be asserted when n consecutive
\r
217 samples of the analog input are seen to exceed the value of the flag threshold,
\r
218 where n is the number selected in the "assert samples" option of the ACE
\r
219 configuration softwaretool flag's configuration.
\r
220 The flag will be de-asserted once m consecutive samples as seen below the flag
\r
221 threshold value, where m is the number selected in the "deassert samples"
\r
222 option of the flag's configuration user interface.
\r
224 #define STATE_FILTERED_OVER 2u
\r
227 A flag configured as STATE_FILTERED_UNDER will be asserted when n consecutive
\r
228 samples of the analog input are seen below the value of the flag threshold,
\r
229 where n is the number selected in the "assert samples" option of the ACE
\r
230 configuration softwaretool flag's configuration.
\r
231 The flag will be de-asserted once m consecutive samples as seen to exceed the
\r
232 flag threshold value, where m is the number selected in the "deassert samples"
\r
233 option of the flag's configuration user interface.
\r
235 #define STATE_FILTERED_UNDER 3u
\r
238 A flag configured as DUAL_HYSTERESIS_OVER will be asserted when the value
\r
239 of the input channel exceeds the threshold value plus the hysteresis value.
\r
240 The flag will be deasserted when the value of the input channel falls under the
\r
241 threshold value minus the hysteresis value.
\r
243 #define DUAL_HYSTERESIS_OVER 4u
\r
246 A flag configured as DUAL_HYSTERESIS_UNDER will be asserted when the value
\r
247 of the input channel falls under the threshold value minus the hysteresis value.
\r
248 The flag will be deasserted when the value of the input channel exceeds the
\r
249 threshold value plus the hysteresis value.
\r
251 #define DUAL_HYSTERESIS_UNDER 5u
\r
254 A flag configured as IPMI_HYSTERESIS_OVER will be asserted when the value
\r
255 of the input channel exceeds the threshold value. The flag will be deasserted
\r
256 when the value of the input channel falls under the threshold value minus the
\r
259 #define IPMI_HYSTERESIS_OVER 6u
\r
262 A flag configured as IPMI_HYSTERESIS_UNDER will be asserted when the value
\r
263 of the input channel falls under the threshold value. The flag will be
\r
264 deasserted when the value of the input channel exceeds the threshold value
\r
265 plus the hysteresis value.
\r
267 #define IPMI_HYSTERESIS_UNDER 7u
\r
269 /*-------------------------------------------------------------------------*//**
\r
270 State filtered flag configuration.
\r
272 typedef struct __state_filtering_cfg
\r
275 Number of consecutive samples required for flag assertion.
\r
277 uint8_t assert_samples;
\r
280 Number of consecutive samples required for flag deassertion.
\r
282 uint8_t deassert_samples;
\r
283 } state_filtering_cfg_t;
\r
285 /*-------------------------------------------------------------------------*//**
\r
286 Post Processing Engine generated flag descriptor.
\r
291 Pointer to a zero-terminated string identifying the flag described by this
\r
292 structure. This unique flag name is the name selected in the ACE configurator
\r
293 software tool when creating a flag.
\r
294 The flag unique name contains both the name of the monitored input channel
\r
295 and the name of the flag generated based the level of that input separated
\r
296 by ":". For example, the unique name for the flag called "CriticalOver"
\r
297 raised when the input channel called "MainSupply" reaches a critical level
\r
298 would be named "MainSupply:CriticalOver".
\r
300 const uint8_t * p_sz_flag_name;
\r
303 The flag_id element identifies which PPE hardware flag will be asserted
\r
304 when the flag conditions are found to be met by the Post Processing Engine.
\r
305 This flag_id is typically used by the ACE driver to determine which ACE
\r
306 register is used to enable, disable and clear interrupts on the associated
\r
309 ppe_flag_id_t flag_id;
\r
312 The flag_type element specifies the type of the described flag. It is
\r
313 specified using one of the following:
\r
314 - BASIC_THRESHOLD_OVER
\r
315 - BASIC_THRESHOLD_UNDER
\r
316 - STATE_FILTERED_OVER
\r
317 - STATE_FILTERED_UNDER
\r
318 - DUAL_HYSTERESIS_OVER
\r
319 - DUAL_HYSTERESIS_UNDER
\r
320 - IPMI_HYSTERESIS_OVER
\r
321 - IPMI_HYSTERESIS_UNDER
\r
326 PPE RAM offset of flag threshold level.
\r
327 This is the 32-bit word offset within the Post Processing Engine RAM where
\r
328 the threshold associated with this flag is stored. This is used to allow
\r
329 the ACE driver dynamically modifying the threshold beyond which a flag is
\r
331 In the case of hysteresis flags, threshold_ppe_offset indicates the
\r
332 start location of two consecutive PPE RAM words containing the ADC value
\r
333 of the hysteresis low limit followed by the ADC value for the high
\r
336 uint16_t threshold_ppe_offset;
\r
339 The default_threshold element specifies the value of the flag's threshold
\r
340 selected in the ACE Configurator. It is the ADC value for which the flag
\r
341 would be raised if hysteresis was not applied.
\r
343 uint16_t default_threshold;
\r
346 The flag_properties takes a different meaning depending whether the flag is
\r
347 an hysteresis flag or a state filtered flag.
\r
350 The flag_properties element specifies the ADC value to be applied as
\r
351 hysteresis to the threshold value that was selected in the ACE Configurator.
\r
352 A non-zero value indicates that an hysteresis must be applied and that
\r
353 threshold_ppe_offset refers to the first of the two ADC values defining
\r
354 the hysteresis applied to the input signal.
\r
356 State filtered flags:
\r
357 The flag_properties element specifies the number of consecutive samples that
\r
358 must be over or under the threshold value for the flag state to change.
\r
360 uint16_t flag_properties;
\r
363 The channel_handle element specifies the monitored analog input channel.
\r
364 It can be used as parameter to a call to function ACE_get_ppe_sample() in
\r
365 order to read the current value of the analog input channel which caused
\r
366 the flag described by this structure to be raised.
\r
368 ace_channel_handle_t channel_handle;
\r
372 /*-------------------------------------------------------------------------*//**
\r
373 The ace_procedure_desc_t structure is used as a procedure descriptor. It
\r
374 contains all information required by the ACE driver to use and manage an ACE
\r
375 procedure that was created using the ACE Configurator software tool.
\r
380 Pointer to a zero-terminated string identifying an ACE procedure.
\r
381 This procedure name is the one selected when created procedures using the
\r
382 ACE Configurator software tool.
\r
384 const uint8_t * p_sz_proc_name;
\r
387 Sample Sequencing Engine procedure loop start program counter value.
\r
389 uint16_t sse_loop_pc;
\r
392 Sample Sequencing Engine microcode offset.
\r
393 This is the 16-bit instruction offset from which the SSE microcode for the
\r
394 procedure must be loaded at into the ACE SSE RAM.
\r
395 This is also the value that must be writtent into one of the ACE's SSE program
\r
396 counter registers in order to start the procedure after having loaded its
\r
397 microcode into SSE RAM. The actual program counter register written depends
\r
398 on the analog module used by the procedure. It is determined by the value
\r
399 of this structure's sse_pc_id element.
\r
401 uint16_t sse_load_offset;
\r
404 Sample Sequencing Engine microcode length.
\r
405 This is the number of 16-bit SSE instructions that must be loaded into
\r
406 SSE RAM in order to load the procedure into the ACE.
\r
408 uint16_t sse_ucode_length;
\r
413 const uint16_t * sse_ucode;
\r
416 SSE program counter ID.
\r
417 This value identifies whether the procedure is used to control analog
\r
418 module 0, 1 or 2. It is used to know which SSE program counter should
\r
419 be set when starting the procedure.
\r
422 } ace_procedure_desc_t;
\r
424 /*-------------------------------------------------------------------------*//**
\r
425 The ace_channel_desc_t structure is used as an analog input channel
\r
426 descriptor. It contains the name of a channel as selected in the ACE
\r
427 Configurator software tool and the identifier used to identify the ADC channel
\r
428 to which the analog input signal is connected.
\r
433 Analog input signal name as selected in the ACE Configurator software tool.
\r
435 const uint8_t * p_sz_channel_name;
\r
438 Analog block input channel connected to the input signal.
\r
440 adc_channel_id_t signal_id;
\r
443 Offset into Post Processing Engine RAM where the result of post processing
\r
444 on sample for the signal will be stored.
\r
446 uint16_t signal_ppe_offset;
\r
449 Number of PPE generated flags associated with the analog input channel
\r
450 described by this structure. The nb_of_flags specifies the number of items
\r
451 found in the p_flags_array array.
\r
453 uint16_t nb_of_flags;
\r
456 The p_flags_array element is a pointer to an array of indexes into the
\r
457 g_ppe_flags_desc_table flag descriptors table. The array it points to
\r
458 lists the flags generated base don the value of the analog input channel
\r
459 described by this structure.
\r
461 const uint16_t * p_flags_array;
\r
463 } ace_channel_desc_t;
\r
465 /*-------------------------------------------------------------------------*//**
\r
466 struct ace_config_desc_t
\r
467 The ace_config_descr_t structure is used to provide information about the
\r
468 configuration of the ACE and analog block. A single instance of this structure
\r
469 is intended to be used to inform the ACE driver of the ACE configuration
\r
470 seleted using the ACE Configurator software tool and programmed into the ACE
\r
471 hardware at system boot time.
\r
475 /*--------------------------------------------------------------------------
\r
476 * Procedures information
\r
479 Procedure descriptors table location.
\r
480 This is a pointer to an array of procedure descriptors.
\r
481 @see nb_of_procedures
\r
483 ace_procedure_desc_t * proc_descr_table;
\r
486 Total number of available procedures. This indicates the number of elements
\r
487 of the procedure descriptor array.
\r
488 @see proc_descr_table
\r
490 uint16_t nb_of_procedures;
\r
493 Number of procedures loaded into the ACE hardware at system boot time.
\r
494 @see boot_loaded_proc_idx_list
\r
496 uint16_t nb_boot_loaded_proc;
\r
498 Pointer to list of procedures loaded into the ACE hardware at system boot
\r
499 time. That list contains the indexes into the procedure descriptors array
\r
500 of the procedures loaded into the ACE hardware.
\r
501 @see nb_boot_loaded_proc
\r
503 uint16_t * boot_loaded_proc_idx_list;
\r
505 /*--------------------------------------------------------------------------
\r
506 * Analog to Digital Converter signals
\r
509 Total number of configured analog input signals.
\r
510 This is the number of analog input signals that were added to the ACE
\r
511 configuration using the ACE Configurator software tool. It is also the
\r
512 number of elements in the signal descriptor table pointed to by this
\r
513 structure's signals_descr_table field.
\r
514 @see signals_descr_table
\r
516 uint16_t nb_of_signals;
\r
519 Signal descriptors table location.
\r
520 This is a pointer to an array of signal descriptors describing every
\r
521 configured analog input signals.
\r
524 ace_channel_desc_t * signals_descr_table;
\r
526 /*--------------------------------------------------------------------------
\r
530 One Bit DAC (OBD) names as specified in ACE configurator software tool.
\r
531 This array is indexed on the analog block number. i.e. sz_obd_names[0]
\r
532 contains the name used to identify the OBD contained in analog module 0.
\r
533 A value of 0 in this array indicates that no name was assigned to the
\r
536 const uint8_t * sz_obd_names[3];
\r
538 /*--------------------------------------------------------------------------
\r
539 * PPE generated flags
\r
542 Flag descriptors array location.
\r
543 This is a pointer to an array of ppe_flag_desc_t structures describing the
\r
544 properties of each of the flags generated by the Post Processing Engine.
\r
545 The size of that array is specified by the nb_of_flags element of this
\r
548 ppe_flag_desc_t * flags_descr_table;
\r
551 Number of flags used in the ACE Configurator generated configuration.
\r
553 uint8_t nb_of_flags;
\r
555 /*--------------------------------------------------------------------------
\r
556 * Analog comparators
\r
561 } ace_config_desc_t;
\r
564 /*-------------------------------------------------------------------------*//**
\r
565 The ace_adc_config_t data structure is used by the ACE configurator to inform
\r
566 the ACE driver of an analog to digital converter's configuration.
\r
571 ADC resolution. Values can be 256, 1024 or 4096 depending whether the ADC
\r
572 is configured for 8, 10 or 12 bits.
\r
574 uint16_t adc_resolution;
\r
577 VA_REF value in milli-Volts. This should be set to 2560 if internal VAREF
\r
582 } ace_adc_config_t;
\r
584 /*-------------------------------------------------------------------------*//**
\r
585 The ppe_transforms_desc_t data structure is used by the ACE configurator to
\r
586 inform the ACE driver of the location of the "m" factor and "c" offset used
\r
587 by the PPE to perform a linear transform of the form y = m*x + c. This linear
\r
588 transform is used to apply calibration to the ADC samples. It can also include
\r
589 a user defined linear transform specified by the user using the ACE
\r
590 configurator. The factor and offset of the user defined transform is included
\r
591 in the default_m2 and default_c2 items.
\r
596 Offset into Post Processing Engine RAM where the linear transform m factor
\r
599 uint16_t m_ppe_offset;
\r
602 Offset into Post Processing Engine RAM where the linear transform c offset
\r
605 uint16_t c_ppe_offset;
\r
608 Default value of the user defined linear transform m2 factor.
\r
610 int16_t default_m2;
\r
613 Default value of the user defined linear transform c2 offset.
\r
615 int16_t default_c2;
\r
616 } ppe_transforms_desc_t;
\r
622 #endif /* __MSS_ACE_CONFIGURATOR_H_ */
\r