forked from rokath/trice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trice.h
936 lines (830 loc) · 36.3 KB
/
trice.h
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
/*! \file trice.h
\author thomas.hoehenleitner [at] seerose.net
*******************************************************************************/
#ifndef TRICE_H_
#define TRICE_H_
#include "triceConfig.h"
#include <stdint.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////
// Declarations and Defaults
size_t TriceDepthMax( void );
extern uint32_t* TriceBufferWritePosition;
unsigned TriceCOBSEncode( uint8_t* restrict output, const uint8_t * restrict input, unsigned length);
void TriceOut( uint32_t* tb, size_t tLen );
void TriceTransfer( void );
void TriceCheckSet( int index ); //!< tests
#if defined( TRICE_UART ) && !defined( TRICE_HALF_BUFFER_SIZE ) // direct out to UART
#define TRICE_WRITE( buf, len ) do{ TriceBlockingWrite( buf, len ); }while(0)
#endif
#ifdef TRICE_RTT_CHANNEL
#include "SEGGER_RTT.h"
#if defined(TRICE_HALF_BUFFER_SIZE) && TRICE_HALF_BUFFER_SIZE > BUFFER_SIZE_UP
#error
#endif
#if defined(TRICE_STACK_BUFFER_SIZE) && TRICE_STACK_BUFFER_SIZE > BUFFER_SIZE_UP
#error
#endif
#define TRICE_WRITE( buf, len ) do{ SEGGER_RTT_Write(TRICE_RTT_CHANNEL, buf, len ); }while(0)
static inline int TriceOutDepth( void ){ return 0; }
#endif // #ifdef TRICE_RTT_CHANNEL
//! The TRICE_PUT_PREFIX macro adds optionally target timestamp and location in front of each trice
#if !defined(TRICE_LOCATION) && !defined(TRICE_TIMESTAMP)
#define TRICE_COBS_PACKAGE_MODE 0
#define TRICE_PUT_PREFIX
#define TRICE_PREFIX_SIZE 0
#endif
#if !defined(TRICE_LOCATION) && defined(TRICE_TIMESTAMP)
#define TRICE_COBS_PACKAGE_MODE 1
#define TRICE_PUT_PREFIX TRICE_PUT(TRICE_TIMESTAMP);
#define TRICE_PREFIX_SIZE 4
#endif
#if defined(TRICE_LOCATION) && !defined(TRICE_TIMESTAMP)
#define TRICE_COBS_PACKAGE_MODE 2
#define TRICE_PUT_PREFIX TRICE_PUT(TRICE_LOCATION);
#define TRICE_PREFIX_SIZE 4
#endif
#if defined(TRICE_LOCATION) && defined(TRICE_TIMESTAMP)
#define TRICE_COBS_PACKAGE_MODE 3
#define TRICE_PUT_PREFIX TRICE_PUT(TRICE_LOCATION); TRICE_PUT(TRICE_TIMESTAMP);
#define TRICE_PREFIX_SIZE 8
#endif
#ifndef TRICE_CYCLE_COUNTER
#define TRICE_CYCLE_COUNTER 1 //! TRICE_CYCLE_COUNTER adds a cycle counter to each trice message. The TRICE macros are a bit slower. Lost TRICEs are detectable by the trice tool.
#endif
//! TRICE_DATA_OFFSET is the space in front of trice data for in-buffer COBS encoding. It must be be a multiple of uint32_t.
#if defined(TRICE_HALF_BUFFER_SIZE)
#define TRICE_DATA_OFFSET ((9+(TRICE_HALF_BUFFER_SIZE/256))&~3) // 9: COBS_DESCRIPTOR size plus start byte plus up to 4 0-delimiters
#else
#define TRICE_DATA_OFFSET 16 // usually 8 is enough: 4 for COBS_DESCRIPTOR and additional bytes for COBS encoding, but the buffer can get big.
#endif
#if defined(TRICE_STACK_BUFFER_MAX_SIZE) && !defined(TRICE_SINGLE_MAX_SIZE)
#define TRICE_SINGLE_MAX_SIZE (TRICE_STACK_BUFFER_MAX_SIZE - TRICE_DATA_OFFSET)
#endif
#ifndef TRICE_SINGLE_MAX_SIZE
#define TRICE_SINGLE_MAX_SIZE 1008 //!< TRICE_SINGLE_MAX_SIZE ist the head size plus string length size plus max dynamic string size. Must be a multiple of 4. 1008 is the max allowed value.
#endif
#if TRICE_SINGLE_MAX_SIZE > 1008
#error
#endif
#if defined(TRICE_STACK_BUFFER_MAX_SIZE) && defined(TRICE_SINGLE_MAX_SIZE) && TRICE_SINGLE_MAX_SIZE + TRICE_DATA_OFFSET > TRICE_STACK_BUFFER_MAX_SIZE
#error
#endif
#if defined(TRICE_HALF_BUFFER_SIZE) && TRICE_HALF_BUFFER_SIZE < TRICE_SINGLE_MAX_SIZE + TRICE_DATA_OFFSET
#error
#endif
#ifndef TRICE_TRANSFER_INTERVAL_MS
//! TRICE_TRANSFER_INTERVAL_MS is the milliseconds interval for TRICE buffer read out.
//! This time should be shorter than visible delays. The TRICE_HALF_BUFFER_SIZE must be able to hold all trice messages possibly occouring in this time.
#define TRICE_TRANSFER_INTERVAL_MS 100
#endif
#if TRICE_CYCLE_COUNTER == 1
extern uint8_t TriceCycle;
#define TRICE_CYCLE TriceCycle++ //! TRICE_CYCLE is the trice cycle counter as 8 bit count 0-255.
#else
#define TRICE_CYCLE 0xC0 //! TRICE_CYCLE is no trice cycle counter, just a static value.
#endif
//
///////////////////////////////////////////////////////////////////////////////
#define TRICE_PUT(x) do{ *TriceBufferWritePosition++ = x; }while(0) //! PUT copies a 32 bit x into the TRICE buffer.
#ifdef TRICE_BIG_ENDIANNESS
#define TRICE_PUT64(x) TRICE_PUT( (uint32_t)((uint64_t)(x)>>32) ); TRICE_PUT( (uint32_t)(x) );
#else
#define TRICE_PUT64(x) TRICE_PUT( (uint32_t)(x) ); TRICE_PUT( (uint32_t)((uint64_t)(x)>>32) );
#endif
#define TRICE_PUTBUFFER( buf, len ) do{ memcpy( TriceBufferWritePosition, buf, len ); TriceBufferWritePosition += (len+3)>>2; }while(0) //! TRICE_PUTBUFFER copies a buffer into the TRICE buffer.
///////////////////////////////////////////////////////////////////////////////
// trice time measurement (STM32 only?)
//
#if defined( __arm__ ) /* Defined by GNU C and RealView */ \
|| defined( __thumb__ ) /* Defined by GNU C and RealView in Thumb mode */ \
|| defined( _ARM ) /* Defined by ImageCraft C */ \
|| defined( _M_ARM ) /* Defined by Visual Studio */ \
|| defined( _M_ARMT ) /* Defined by Visual Studio in Thumb mode */ \
|| defined( __arm ) /* Defined by Diab */ \
|| defined( __ICCARM__ ) /* IAR */ \
|| defined( __CC_ARM ) /* ARM's (RealView) compiler */ \
|| defined( __ARM__ ) /* TASKING VX ARM toolset C compiler */ \
|| defined( __CARM__ ) /* TASKING VX ARM toolset C compiler */ \
|| defined( __CPARM__ ) /* TASKING VX ARM toolset C++ compiler */
#define SYSTICKVAL (*(volatile uint32_t*)0xE000E018UL)
#else
//#error "unknown architecture"
#define SYSTICKVAL 0
#endif
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// UART interface
//
#if defined( TRICE_UART ) && !defined( TRICE_HALF_BUFFER_SIZE ) // direct out to UART
void TriceBlockingWrite( uint8_t const * buf, int len );
#endif
#if defined( TRICE_UART ) && defined( TRICE_HALF_BUFFER_SIZE ) // buffered out to UART
uint8_t TriceNextUint8( void );
void triceServeTransmit(void);
void triceTriggerTransmit(void);
int TriceOutDepth( void );
uint8_t TriceNextUint8( void );
#endif // #if defined( TRICE_UART ) && TRICE_MODE != 0
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Encryption
//
#ifdef TRICE_ENCRYPT
void TriceEncrypt( uint32_t* p, unsigned count );
void TriceDecrypt( uint32_t* p, unsigned count );
//! little endian! change byte order for big endian machines
#define XTEA_KEY(b00, b01, b02, b03, \
b10, b11, b12, b13, \
b20, b21, b22, b23, \
b30, b31, b32, b33) { \
0x##b00##b01##b02##b03, \
0x##b10##b11##b12##b13, \
0x##b20##b21##b22##b23, \
0x##b30##b31##b32##b33 }
void TriceInitXteaTable(void);
#endif // #ifdef TRICE_ENCRYPT
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Variadic macros (https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms)
// This is extendable until a 1000 bytes payload.
#define TRICE8_COUNT(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, NAME,...) NAME
#define TRICE8(id,frmt, ...) TRICE8_COUNT(__VA_ARGS__,TRICE8_12,TRICE8_11,TRICE8_10,TRICE8_9,TRICE8_8,TRICE8_7,TRICE8_6,TRICE8_5,TRICE8_4,TRICE8_3,TRICE8_2,TRICE8_1)(id,frmt, __VA_ARGS__)
#define TRICE16_COUNT(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, NAME,...) NAME
#define TRICE16(id,frmt, ...) TRICE16_COUNT(__VA_ARGS__,TRICE16_12,TRICE16_11,TRICE16_10,TRICE16_9,TRICE16_8,TRICE16_7,TRICE16_6,TRICE16_5,TRICE16_4,TRICE16_3,TRICE16_2,TRICE16_1)(id,frmt, __VA_ARGS__)
#define TRICE32_COUNT(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, NAME,...) NAME
#define TRICE32(id,frmt, ...) TRICE32_COUNT(__VA_ARGS__,TRICE32_12,TRICE32_11,TRICE32_10,TRICE32_9,TRICE32_8,TRICE32_7,TRICE32_6,TRICE32_5,TRICE32_4,TRICE32_3,TRICE32_2,TRICE32_1)(id,frmt, __VA_ARGS__)
#define TRICE64_COUNT(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, NAME,...) NAME
#define TRICE64(id,frmt, ...) TRICE64_COUNT(__VA_ARGS__,TRICE64_12,TRICE64_11,TRICE64_10,TRICE64_9,TRICE64_8,TRICE64_7,TRICE64_6,TRICE64_5,TRICE64_4,TRICE64_3,TRICE64_2,TRICE64_1)(id,frmt, __VA_ARGS__)
// See for more explanation https://renenyffenegger.ch/notes/development/languages/C-C-plus-plus/preprocessor/macros/__VA_ARGS__/count-arguments
//! NTH_ARGUMENT just evaluates to the 14th argument. It is extendable.
#define NTH_ARGUMENT(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, ...) a14
//! COUNT_ARGUMENTS builds upon NTH_ARGUMENT. The more arguments that are passed to COUNT_ARGUMENTS,
//! the more the »counting arguments« (12, 11, 10, 9, 8, 7…) are pushed to the right.
//! Thus the macro evaluates to the number of arguments that are passed to the macro.
//! The expression `## __VA_ARGS__` ist not supported by older compilers. You can remove the `##` and use TRICE0 instead of TRICE for a no parameter value TRICE in that case.
#define COUNT_ARGUMENTS(...) NTH_ARGUMENT(dummy, ## __VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
//! CONCAT concatenates the 2 arguments a and b (helper macro).
#define CONCAT(a, b) a ## b
//! CONCAT2 concatenates the 2 arguments a and b (helper macro).
#define CONCAT2(a, b) CONCAT(a, b)
//! TRICE_VARIABLE_ARGUMENTS concatenates DEBUG_ with the result of COUNT_ARGUMENTS to produce something like DEBUG_2 which takes a printf-format and two arguments.
#define TRICE(id, fmt, ...) CONCAT2(TRICE_, COUNT_ARGUMENTS(__VA_ARGS__))(id, fmt, ##__VA_ARGS__)
//
///////////////////////////////////////////////////////////////////////////////
/* pre C99
// aFloat returns passed float value x as bit pattern in a uint32_t type.
static inline uint32_t aFloat( float x ){
union {
float f;
uint32_t u;
} t;
t.f = x;
return t.u;
}
*/
// aFloat returns passed float value x as bit pattern in a uint32_t type.
static inline uint32_t aFloat( float f ){
union {
float from;
uint32_t to;
} pun = { .from = f };
return pun.to;
}
// asFloat returns passed uint32_t value x bit pattern as float type.
static inline float asFloat( uint32_t x ){
union {
uint32_t from;
float to;
} pun = { .from = x };
return pun.to;
}
// aDouble returns passed double value x as bit pattern in a uint64_t type.
static inline uint64_t aDouble( double x ){
union {
double d;
uint64_t u;
} t;
t.d = x;
return t.u;
}
///////////////////////////////////////////////////////////////////////////////
// TRICE macros
//
#define TRICE_INTO TRICE_ENTER TRICE_PUT_PREFIX;
//! TRICE_S writes id and dynString.
//! \param id trice identifier
//! \param pFmt formatstring for trice (ignored here but used by the trice tool)
//! \param dynString 0-terminated runtime generated string
//! After the 4 byte trice message header are following 2^n bytes
//! string transfer format:
//! idH idL len cycle
//! c0 c1 c2 c3
//! ...
//! cLen-3 cLen-2 cLen-1 cLen
#define TRICE_S( id, pFmt, dynString) do { \
uint32_t len = strlen( dynString ); \
uint32_t limit = TRICE_SINGLE_MAX_SIZE-TRICE_PREFIX_SIZE-8; /* 8 = head + len size */ \
if( len > limit ){ \
TRICE32( Id( 54343), "wrn:Dynamic string truncated from %u to %u\n", len, limit ); \
len = limit; \
} \
TRICE_INTO; \
TRICE_PUT( id | (0xff00 & ((len+7)<<6)) | TRICE_CYCLE ); /* +3 for padding, +4 for the buf size value transmitted in the payload to get the last 2 bits. */ \
TRICE_PUT( len ); /* len as byte does not contain the exact buf len anymore, so transmit it to the host */ \
/* len is needed for non string buffers because the last 2 bits not stored in head. */ \
/* All trices know the data length but not TRICE8P. len byte values 0xFC, xFD, xFE, xFF are reserved for future extensions. */ \
TRICE_PUTBUFFER( dynString, len ); \
TRICE_LEAVE \
} while(0)
#ifdef TRICE_OFF // do not generate trice code for files defining TRICE_OFF before including "trice.h"
#undef TRICE_INTO
#define TRICE_INTO
#undef TRICE_PUT
#define TRICE_PUT(n) do{ ((void)(n)); }while(0)
#undef PUT_BUFFER
#define PUT_BUFFER(b,l) do{ ((void)(b)); ((void)(l)); }while(0)
#undef TRICE_LEAVE
#define TRICE_LEAVE
#undef TRICE_S
#define TRICE_S( id, p, s ) do{ ((void)(id)); ((void)(p)); ((void)(s)); }while(0)
#endif // #ifdef TRICE_OFF
#define Id(n) ((uint32_t)n<<16) //!< Id() is a 16 bit id 0-65535 as upper 2 bytes in head
//! TRICE0 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
#define TRICE0( id, pFmt ) \
TRICE_INTO \
TRICE_PUT( id | 0x0000 | TRICE_CYCLE ); \
TRICE_LEAVE
#define TRICE_BYTE0(v)((uint8_t)(v))
#define TRICE_BYTE1(v)(0x0000FF00 & ((uint32_t)(v)<< 8))
#define TRICE_BYTE2(v)(0x00FF0000 & ((uint32_t)(v)<<16))
#define TRICE_BYTE3(v)((uint32_t)(v)<<24)
//! TRICE8_1 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 a 8 bit bit value
#define TRICE8_1( id, pFmt, v0 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE0(v0)); /* little endian*/ \
TRICE_LEAVE
//! TRICE8_2 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v1 are 8 bit bit values
#define TRICE8_2( id, pFmt, v0, v1 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_LEAVE
//! TRICE8_3 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v2 are 8 bit bit values
#define TRICE8_3( id, pFmt, v0, v1, v2 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_LEAVE
//! TRICE8_4 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v3 are 8 bit bit values
#define TRICE8_4( id, pFmt, v0, v1, v2, v3 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_LEAVE
//! TRICE8_5 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v4 are 8 bit bit values
#define TRICE8_5( id, pFmt, v0, v1, v2, v3, v4 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE0(v4)); \
TRICE_LEAVE
//! TRICE8_6 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v5 are 8 bit bit values
#define TRICE8_6( id, pFmt, v0, v1, v2, v3, v4, v5 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_LEAVE
//! TRICE8_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v6 are 8 bit bit values
#define TRICE8_7( id, pFmt, v0, v1, v2, v3, v4, v5, v6 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE2(v6) |TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_LEAVE
//! TRICE8_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 8 bit bit values
#define TRICE8_8( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE3(v7) |TRICE_BYTE2(v6) |TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_LEAVE
//! TRICE8_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 8 bit bit values
#define TRICE8_9( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE3(v7) |TRICE_BYTE2(v6) |TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_PUT( TRICE_BYTE0(v8)); \
TRICE_LEAVE
//! TRICE8_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 8 bit bit values
#define TRICE8_10( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE3(v7) |TRICE_BYTE2(v6) |TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_PUT( TRICE_BYTE1(v9) |TRICE_BYTE0(v8)); \
TRICE_LEAVE
//! TRICE8_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 8 bit bit values
#define TRICE8_11( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE3(v7) |TRICE_BYTE2(v6) |TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_PUT( TRICE_BYTE2(v10)|TRICE_BYTE1(v9) |TRICE_BYTE0(v8)); \
TRICE_LEAVE
//! TRICE8_12 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v11 are 8 bit bit values
#define TRICE8_12( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT( TRICE_BYTE3(v3) |TRICE_BYTE2(v2) |TRICE_BYTE1(v1) |TRICE_BYTE0(v0)); \
TRICE_PUT( TRICE_BYTE3(v7) |TRICE_BYTE2(v6) |TRICE_BYTE1(v5) |TRICE_BYTE0(v4)); \
TRICE_PUT( TRICE_BYTE3(v11)|TRICE_BYTE2(v10)|TRICE_BYTE1(v9) |TRICE_BYTE0(v8)); \
TRICE_LEAVE
//! TRICE16_1 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 a 16 bit value
#define TRICE16_1( id, pFmt, v0 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE ); \
TRICE_PUT( (uint16_t)(v0) ); \
TRICE_LEAVE
//! TRICE16_2 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v1 are 16 bit values
#define TRICE16_2( id, pFmt, v0, v1 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_LEAVE
//! TRICE16_3 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v2 are 16 bit values
#define TRICE16_3( id, pFmt, v0, v1, v2 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT( (uint16_t)(v2) ); \
TRICE_LEAVE
//! TRICE16_4 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v3 are 16 bit values
#define TRICE16_4( id, pFmt, v0, v1, v2, v3 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_LEAVE
//! TRICE16_5 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v4 are 16 bit values
#define TRICE16_5( id, pFmt, v0, v1, v2, v3, v4 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) ); \
TRICE_LEAVE
//! TRICE16_6 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v5 are 16 bit values
#define TRICE16_6( id, pFmt, v0, v1, v2, v3, v4, v5 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_LEAVE
//! TRICE16_7 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v6 are 16 bit values
#define TRICE16_7( id, pFmt, v0, v1, v2, v3, v4, v5, v6 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0400 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_PUT((uint16_t)(v6) ); \
TRICE_LEAVE
//! TRICE16_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 16 bit values
#define TRICE16_8( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0400 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_PUT((uint16_t)(v6) | ((uint32_t)(v7)<<16) ); \
TRICE_LEAVE
//! TRICE16_9 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v8 are 16 bit values
#define TRICE16_9( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0500 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_PUT((uint16_t)(v6) | ((uint32_t)(v7)<<16) ); \
TRICE_PUT((uint16_t)(v8) ); \
TRICE_LEAVE
//! TRICE16_10 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v9 are 16 bit values
#define TRICE16_10( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0500 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_PUT((uint16_t)(v6) | ((uint32_t)(v7)<<16) ); \
TRICE_PUT((uint16_t)(v8) | ((uint32_t)(v9)<<16) ); \
TRICE_LEAVE
//! TRICE16_11 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v10 are 16 bit values
#define TRICE16_11( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0600 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_PUT((uint16_t)(v6) | ((uint32_t)(v7)<<16) ); \
TRICE_PUT((uint16_t)(v8) | ((uint32_t)(v9)<<16) ); \
TRICE_PUT((uint16_t)(v10) ); \
TRICE_LEAVE
//! TRICE16_12 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v11 are 16 bit values
#define TRICE16_12( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0600 | TRICE_CYCLE ); \
TRICE_PUT((uint16_t)(v0) | ((uint32_t)(v1)<<16) ); \
TRICE_PUT((uint16_t)(v2) | ((uint32_t)(v3)<<16) ); \
TRICE_PUT((uint16_t)(v4) | ((uint32_t)(v5)<<16) ); \
TRICE_PUT((uint16_t)(v6) | ((uint32_t)(v7)<<16) ); \
TRICE_PUT((uint16_t)(v8) | ((uint32_t)(v9)<<16) ); \
TRICE_PUT((uint16_t)(v10)| ((uint32_t)(v11)<<16) ); \
TRICE_LEAVE
//! TRICE32_1 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 the 32 bit value
#define TRICE32_1( id, pFmt, v0 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0100 | TRICE_CYCLE); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_LEAVE
//! TRICE32_2 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v1 are 32 bit values
#define TRICE32_2( id, pFmt, v0, v1 ) \
TRICE_INTO \
TRICE_PUT(id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_LEAVE
//! TRICE32_3 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v2 are 32 bit values
#define TRICE32_3( id, pFmt, v0, v1, v2 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0300 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_LEAVE
//! TRICE32_4 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v3 are 32 bit values
#define TRICE32_4( id, pFmt, v0, v1, v2, v3 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0400 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_LEAVE
//! TRICE32_5 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v4 are 32 bit values
#define TRICE32_5( id, pFmt, v0, v1, v2, v3, v4 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0500 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_LEAVE
//! TRICE32_6 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v5 are 32 bit values
#define TRICE32_6( id, pFmt, v0, v1, v2, v3, v4, v5 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0600 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_LEAVE
//! TRICE32_7 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v6 are 32 bit values
#define TRICE32_7( id, pFmt, v0, v1, v2, v3, v4, v5, v6 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0700 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_PUT( (uint32_t)(v6) ); \
TRICE_LEAVE
//! TRICE32_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 32 bit values
#define TRICE32_8( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0800 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_PUT( (uint32_t)(v6) ); \
TRICE_PUT( (uint32_t)(v7) ); \
TRICE_LEAVE
//! TRICE32_9 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v8 are 32 bit values
#define TRICE32_9( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0900 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_PUT( (uint32_t)(v6) ); \
TRICE_PUT( (uint32_t)(v7) ); \
TRICE_PUT( (uint32_t)(v8) ); \
TRICE_LEAVE
//! TRICE32_10 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - 9 are 32 bit values
#define TRICE32_10( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0a00 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_PUT( (uint32_t)(v6) ); \
TRICE_PUT( (uint32_t)(v7) ); \
TRICE_PUT( (uint32_t)(v8) ); \
TRICE_PUT( (uint32_t)(v9) ); \
TRICE_LEAVE
//! TRICE32_11 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v10 are 32 bit values
#define TRICE32_11( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0b00 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_PUT( (uint32_t)(v6) ); \
TRICE_PUT( (uint32_t)(v7) ); \
TRICE_PUT( (uint32_t)(v8) ); \
TRICE_PUT( (uint32_t)(v9) ); \
TRICE_PUT( (uint32_t)(v10) ); \
TRICE_LEAVE
//! TRICE32_12 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v11 are 32 bit values
#define TRICE32_12( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0c00 | TRICE_CYCLE ); \
TRICE_PUT( (uint32_t)(v0) ); \
TRICE_PUT( (uint32_t)(v1) ); \
TRICE_PUT( (uint32_t)(v2) ); \
TRICE_PUT( (uint32_t)(v3) ); \
TRICE_PUT( (uint32_t)(v4) ); \
TRICE_PUT( (uint32_t)(v5) ); \
TRICE_PUT( (uint32_t)(v6) ); \
TRICE_PUT( (uint32_t)(v7) ); \
TRICE_PUT( (uint32_t)(v8) ); \
TRICE_PUT( (uint32_t)(v9) ); \
TRICE_PUT( (uint32_t)(v10) ); \
TRICE_PUT( (uint32_t)(v11) ); \
TRICE_LEAVE
//! TRICE64_1 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 is a 64 bit values
#define TRICE64_1( id, pFmt, v0 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0200 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_LEAVE
//! TRICE64_2 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v1 are 64 bit values
#define TRICE64_2( id, pFmt, v0, v1 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0400 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_LEAVE
//! TRICE64_3 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v2 are 64 bit values
#define TRICE64_3( id, pFmt, v0, v1, v2 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0600 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_LEAVE
//! TRICE64_4 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v3 are 64 bit values
#define TRICE64_4( id, pFmt, v0, v1, v2, v3 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0800 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_LEAVE
//! TRICE64_5 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v4 are 64 bit values
#define TRICE64_5( id, pFmt, v0, v1, v2, v3, v4 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0a00 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_LEAVE
//! TRICE64_6 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v5 are 64 bit values
#define TRICE64_6( id, pFmt, v0, v1, v2, v3, v4, v5 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0c00 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_LEAVE
//! TRICE64_7 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v6 are 64 bit values
#define TRICE64_7( id, pFmt, v0, v1, v2, v3, v4, v5, v6 ) \
TRICE_INTO \
TRICE_PUT( id | 0x0e00 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_PUT64( v6 ); \
TRICE_LEAVE
//! TRICE64_8 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v7 are 64 bit values
#define TRICE64_8( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7 ) \
TRICE_INTO \
TRICE_PUT( id | 0x1000 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_PUT64( v6 ); \
TRICE_PUT64( v7 ); \
TRICE_LEAVE
//! TRICE64_9 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v8 are 64 bit values
#define TRICE64_9( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8 ) \
TRICE_INTO \
TRICE_PUT( id | 0x1200 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_PUT64( v6 ); \
TRICE_PUT64( v7 ); \
TRICE_PUT64( v8 ); \
TRICE_LEAVE
//! TRICE64_10 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v9 are 64 bit values
#define TRICE64_10( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9 ) \
TRICE_INTO \
TRICE_PUT( id | 0x1400 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_PUT64( v6 ); \
TRICE_PUT64( v7 ); \
TRICE_PUT64( v8 ); \
TRICE_PUT64( v9 ); \
TRICE_LEAVE
//! TRICE64_11 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v10 are 64 bit values
#define TRICE64_11( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ) \
TRICE_INTO \
TRICE_PUT( id | 0x1600 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_PUT64( v6 ); \
TRICE_PUT64( v7 ); \
TRICE_PUT64( v8 ); \
TRICE_PUT64( v9 ); \
TRICE_PUT64( v10 ); \
TRICE_LEAVE
//! TRICE64_12 writes trice data as fast as possible in a buffer.
//! \param id is a 16 bit Trice id in upper 2 bytes of a 32 bit value
//! \param v0 - v11 are 64 bit values
#define TRICE64_12( id, pFmt, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 ) \
TRICE_INTO \
TRICE_PUT( id | 0x1800 | TRICE_CYCLE ); \
TRICE_PUT64( v0 ); \
TRICE_PUT64( v1 ); \
TRICE_PUT64( v2 ); \
TRICE_PUT64( v3 ); \
TRICE_PUT64( v4 ); \
TRICE_PUT64( v5 ); \
TRICE_PUT64( v6 ); \
TRICE_PUT64( v7 ); \
TRICE_PUT64( v8 ); \
TRICE_PUT64( v9 ); \
TRICE_PUT64( v10 ); \
TRICE_PUT64( v11 ); \
TRICE_LEAVE
#ifdef __cplusplus
}
#endif
#endif // TRICE_H_