rusEFI
The most advanced open source ECU
Public Member Functions | Data Fields | Private Member Functions | Private Attributes
sent_channel Class Reference

#include <sent_logic.h>

Collaboration diagram for sent_channel:
Collaboration graph
[legend]

Public Member Functions

int Decoder (uint32_t clocks, uint8_t flags=0)
 
int GetMsg (uint32_t *rx)
 
int GetSignals (uint8_t *pStat, uint16_t *pSig0, uint16_t *pSig1)
 
int GetSlowChannelValue (uint8_t id)
 
float getTickTime ()
 
void Info ()
 

Data Fields

struct {
   uint16_t   data
 
   uint8_t   id
 
scMsg [SENT_SLOW_CHANNELS_MAX]
 
sent_channel_stat statistic
 

Private Member Functions

int StoreSlowChannelValue (uint8_t id, uint16_t data)
 
int FastChannelDecoder (uint32_t clocks)
 
int SlowChannelDecoder ()
 
void SlowChannelDecoderReset ()
 
uint8_t crc4 (uint32_t data)
 
uint8_t crc4_gm (uint32_t data)
 
uint8_t crc4_gm_v2 (uint32_t data)
 
uint8_t crc6 (uint32_t data)
 
void calcTickPerUnit (uint32_t clocks)
 
bool isSyncPulse (uint32_t clocks)
 
void restart ()
 

Private Attributes

SENT_STATE_enum state = SENT_STATE_CALIB
 
uint32_t tickPerUnit = 0
 
uint32_t pulseCounter = 0
 
uint32_t currentStatePulseCounter = 0
 
bool pausePulseReceived = false
 
uint32_t rxReg
 
bool hasValidFast = false
 
uint32_t rxLast
 
uint16_t scMsgFlags
 
uint32_t scShift2
 
uint32_t scShift3
 
uint32_t scCrcShift
 

Detailed Description

Definition at line 56 of file sent_logic.h.

Member Function Documentation

◆ calcTickPerUnit()

void sent_channel::calcTickPerUnit ( uint32_t  clocks)
private

Definition at line 88 of file sent.cpp.

88  {
89  /* int division with rounding */
90  tickPerUnit = (clocks + (SENT_SYNC_INTERVAL + SENT_OFFSET_INTERVAL) / 2) /
91  (SENT_SYNC_INTERVAL + SENT_OFFSET_INTERVAL);
92 }
uint32_t tickPerUnit
Definition: sent_logic.h:61

Referenced by FastChannelDecoder().

Here is the caller graph for this function:

◆ crc4()

uint8_t sent_channel::crc4 ( uint32_t  data)
private

Definition at line 479 of file sent.cpp.

480 {
481  size_t i;
482  uint8_t crc = SENT_CRC_SEED; // initialize checksum with seed "0101"
483  const uint8_t CrcLookup[16] = {0, 13, 7, 10, 14, 3, 9, 4, 1, 12, 6, 11, 15, 2, 8, 5};
484 
485  for (i = 0; i < 7; i++) {
486  crc = crc ^ MsgGetNibble(data, i);
487  crc = CrcLookup[crc];
488  }
489 
490  return crc;
491 }
uint16_t data
Definition: sent_logic.h:102

Referenced by FastChannelDecoder().

Here is the caller graph for this function:

◆ crc4_gm()

uint8_t sent_channel::crc4_gm ( uint32_t  data)
private

Definition at line 497 of file sent.cpp.

498 {
499  size_t i;
500  uint8_t crc = SENT_CRC_SEED; // initialize checksum with seed "0101"
501  const uint8_t CrcLookup[16] = {0, 13, 7, 10, 14, 3, 9, 4, 1, 12, 6, 11, 15, 2, 8, 5};
502 
503  for (i = 1; i < 7; i++) {
504  crc = CrcLookup[crc];
505  crc = (crc ^ MsgGetNibble(data, i)) & 0xf;
506  }
507 
508  return crc;
509 }

Referenced by FastChannelDecoder().

Here is the caller graph for this function:

◆ crc4_gm_v2()

uint8_t sent_channel::crc4_gm_v2 ( uint32_t  data)
private

Definition at line 513 of file sent.cpp.

514 {
515  size_t i;
516  uint8_t crc = SENT_CRC_SEED; // initialize checksum with seed "0101"
517  const uint8_t CrcLookup[16] = {0, 13, 7, 10, 14, 3, 9, 4, 1, 12, 6, 11, 15, 2, 8, 5};
518 
519  for (i = 1; i < 7; i++) {
520  crc = CrcLookup[crc];
521  crc = (crc ^ MsgGetNibble(data, i)) & 0xf;
522  }
523  // One more round with 0 as input
524  crc = CrcLookup[crc];
525 
526  return crc;
527 }

Referenced by FastChannelDecoder().

Here is the caller graph for this function:

◆ crc6()

uint8_t sent_channel::crc6 ( uint32_t  data)
private

Definition at line 529 of file sent.cpp.

530 {
531  size_t i;
532  /* Seed 0x15 (21) */
533  uint8_t crc = 0x15;
534  /* CRC table for poly = 0x59 (x^6 + x^4 + x^3 + 1) */
535  const uint8_t crc6_table[64] = {
536  0, 25, 50, 43, 61, 36, 15, 22, 35, 58, 17, 8, 30, 7, 44, 53,
537  31, 6, 45, 52, 34, 59, 16, 9, 60, 37, 14, 23, 1, 24, 51, 42,
538  62, 39, 12, 21, 3, 26, 49, 40, 29, 4, 47, 54, 32, 57, 18, 11,
539  33, 56, 19, 10, 28, 5, 46, 55, 2, 27, 48, 41, 63, 38, 13, 20 };
540 
541  for (i = 0; i < 4; i++) {
542  uint8_t tmp = (data >> (24 - 6 * (i + 1))) & 0x3f;
543  crc = tmp ^ crc6_table[crc];
544  }
545  // Extra round with 0 input
546  crc = 0 ^ crc6_table[crc];
547 
548  return crc;
549 }

Referenced by SlowChannelDecoder().

Here is the caller graph for this function:

◆ Decoder()

int sent_channel::Decoder ( uint32_t  clocks,
uint8_t  flags = 0 
)

Definition at line 294 of file sent.cpp.

294  {
295  int ret;
296 
297  #if SENT_STATISTIC_COUNTERS
298  if (flags & SENT_FLAG_HW_OVERFLOW) {
300  }
301  #endif
302 
303  /* TODO: handle flags */
304  (void)flags;
305 
306  ret = FastChannelDecoder(clocks);
307  if (ret > 0) {
308  /* valid packet received, can process slow channels */
310  } else if (ret < 0) {
311  /* packet is incorrect, reset slow channel state machine */
313  }
314 
315  return ret;
316 }
void SlowChannelDecoderReset()
Definition: sent.cpp:470
int FastChannelDecoder(uint32_t clocks)
Definition: sent.cpp:110
int SlowChannelDecoder()
Definition: sent.cpp:403
sent_channel_stat statistic
Definition: sent_logic.h:108
uint32_t hwOverflowCnt
Definition: sent_logic.h:33
Here is the call graph for this function:

◆ FastChannelDecoder()

int sent_channel::FastChannelDecoder ( uint32_t  clocks)
private

Definition at line 110 of file sent.cpp.

110  {
111  pulseCounter++;
112 
113  /* special case - tick time calculation */
114  if (state == SENT_STATE_CALIB) {
115  if ((tickPerUnit == 0) || (currentStatePulseCounter == 0)) {
116  /* invalid or not yet calculated tickPerUnit */
117  calcTickPerUnit(clocks);
118  /* lets assume this is sync pulse... */
120  } else {
121  /* some tickPerUnit calculated...
122  * Check next 1 + 6 + 1 pulses if they are valid with current tickPerUnit */
123  criticalAssert(tickPerUnit != 0, "zero tickPerUnit", 0);
124  int checkInterval = (clocks + tickPerUnit / 2) / tickPerUnit - SENT_OFFSET_INTERVAL;
125  if ((checkInterval >= 0) && (checkInterval <= SENT_MAX_INTERVAL)) {
127  /* Should end up with CRC pulse */
128  if (currentStatePulseCounter == (1 + SENT_MSG_PAYLOAD_SIZE)) {
129  pulseCounter = 0;
132  }
133  } else {
135  calcTickPerUnit(clocks);
136  }
137  }
138  if (pulseCounter >= SENT_CALIBRATION_PULSES) {
139  /* failed to calculate valid tickPerUnit, restart */
140  restart();
141  }
142  return 0;
143  }
144 
145  /* special case for out-of-sync state */
146  if (state == SENT_STATE_INIT) {
147  if (isSyncPulse(clocks)) {
148  /* adjust unit time */
149  calcTickPerUnit(clocks);
150  /* we get here from calibration phase. calibration phase end with CRC nibble
151  * if we had to skip ONE pulse before we get sync - that means device may send pause
152  * pulse in between of messages */
153  pausePulseReceived = false;
154  if (currentStatePulseCounter == 1) {
155  pausePulseReceived = true;
156  }
157  /* next state */
160  } else {
162  /* 3 frames skipped, no SYNC detected - recalibrate */
163  if (currentStatePulseCounter >= (SENT_MSG_TOTAL * 3)) {
164  restart();
165  }
166  }
167  /* done for this pulse */
168  return 0;
169  }
170 
171  int interval = (clocks + tickPerUnit / 2) / tickPerUnit - SENT_OFFSET_INTERVAL;
172 
173  if (interval < 0) {
174  #if SENT_STATISTIC_COUNTERS
176  #endif //SENT_STATISTIC_COUNTERS
178  return -1;
179  }
180 
181  switch(state)
182  {
183  case SENT_STATE_CALIB:
184  case SENT_STATE_INIT:
185  /* handled above, should not get in here */
186  return -1;
187 
188  case SENT_STATE_SYNC:
189  if (isSyncPulse(clocks))
190  {
191  /* measured tick interval will be used until next sync pulse */
192  calcTickPerUnit(clocks);
193  rxReg = 0;
195  }
196  else
197  {
198  if (pausePulseReceived) {
199  #if SENT_STATISTIC_COUNTERS
200  // Increment sync interval err count
201  statistic.SyncErr++;
202  if (interval > SENT_SYNC_INTERVAL)
203  {
205  }
206  else
207  {
209  }
210  #endif // SENT_STATISTIC_COUNTERS
211  /* wait for next sync and recalibrate tickPerUnit */
213  return -1;
214  } else {
215  /* This is possibly pause pulse */
216  /* TODO: check:
217  * Minimum Length 12 ticks (equivalent to a nibble with 0 value) - this is already checked
218  * Maximum Length 768 ticks (3 * 256) */
219  #if SENT_STATISTIC_COUNTERS
221  #endif // SENT_STATISTIC_COUNTERS
222  pausePulseReceived = true;
223  }
224  }
225  return 0;
226 
227  case SENT_STATE_STATUS:
228  /* it is possible that pause pulse was threaded as sync and we are here with sync pulse */
229  if ((pausePulseReceived == false) && isSyncPulse(clocks)) {
230  #if SENT_STATISTIC_COUNTERS
232  #endif // SENT_STATISTIC_COUNTERS
233  /* measured tick interval will be used until next sync pulse */
234  calcTickPerUnit(clocks);
235  return 0;
236  }
237  // fallthrough
244  case SENT_STATE_CRC:
245  if (interval > SENT_MAX_INTERVAL)
246  {
247  #if SENT_STATISTIC_COUNTERS
249  #endif
250 
252  return -1;
253  }
254 
255  rxReg = (rxReg << 4) | (uint32_t)interval;
256 
257  if (state != SENT_STATE_CRC)
258  {
259  /* TODO: refactor */
260  state = (SENT_STATE_enum)((int)state + 1);
261  return 0;
262  }
263 
264  #if SENT_STATISTIC_COUNTERS
266  #endif // SENT_STATISTIC_COUNTERS
267  pausePulseReceived = false;
269  /* CRC check */
270  /* TODO: find correct way to calculate CRC */
271  if ((MsgGetCrc(rxReg) == crc4(rxReg)) ||
272  (MsgGetCrc(rxReg) == crc4_gm(rxReg)) ||
273  (MsgGetCrc(rxReg) == crc4_gm_v2(rxReg)))
274  {
275  /* Full packet with correct CRC has been received */
276  rxLast = rxReg;
277  hasValidFast = true;
278  /* TODO: add timestamp? */
279  return 1;
280  }
281  else
282  {
283  #if SENT_STATISTIC_COUNTERS
285  #endif // SENT_STATISTIC_COUNTERS
286  return -1;
287  }
288  return 0;
289  }
290 
291  return 0;
292 }
bool pausePulseReceived
Definition: sent_logic.h:65
bool isSyncPulse(uint32_t clocks)
Definition: sent.cpp:98
uint32_t pulseCounter
Definition: sent_logic.h:62
uint8_t crc4_gm_v2(uint32_t data)
Definition: sent.cpp:513
uint8_t crc4(uint32_t data)
Definition: sent.cpp:479
void restart()
Definition: sent.cpp:64
uint8_t crc4_gm(uint32_t data)
Definition: sent.cpp:497
void calcTickPerUnit(uint32_t clocks)
Definition: sent.cpp:88
uint32_t rxReg
Definition: sent_logic.h:68
SENT_STATE_enum state
Definition: sent_logic.h:58
uint32_t rxLast
Definition: sent_logic.h:71
bool hasValidFast
Definition: sent_logic.h:69
uint32_t currentStatePulseCounter
Definition: sent_logic.h:64
SENT_STATE_enum
Definition: sent_logic.h:18
@ SENT_STATE_CALIB
Definition: sent_logic.h:19
@ SENT_STATE_STATUS
Definition: sent_logic.h:22
@ SENT_STATE_SIG2_DATA1
Definition: sent_logic.h:26
@ SENT_STATE_SIG1_DATA2
Definition: sent_logic.h:24
@ SENT_STATE_SIG1_DATA3
Definition: sent_logic.h:25
@ SENT_STATE_SIG1_DATA1
Definition: sent_logic.h:23
@ SENT_STATE_SIG2_DATA2
Definition: sent_logic.h:27
@ SENT_STATE_INIT
Definition: sent_logic.h:20
@ SENT_STATE_SYNC
Definition: sent_logic.h:21
@ SENT_STATE_CRC
Definition: sent_logic.h:29
@ SENT_STATE_SIG2_DATA3
Definition: sent_logic.h:28
uint32_t FrameCnt
Definition: sent_logic.h:39
uint32_t PauseCnt
Definition: sent_logic.h:40
uint32_t SyncErr
Definition: sent_logic.h:37
uint32_t ShortIntervalErr
Definition: sent_logic.h:35
uint32_t CrcErrCnt
Definition: sent_logic.h:38
uint32_t LongIntervalErr
Definition: sent_logic.h:36

Referenced by Decoder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMsg()

int sent_channel::GetMsg ( uint32_t *  rx)

Definition at line 318 of file sent.cpp.

318  {
319  if (rx) {
320  *rx = rxLast;
321  }
322 
323  if (!hasValidFast) {
324  return -1;
325  }
326  /* TODO: add check for time since last message received */
327  return 0;
328 }

Referenced by GetSignals().

Here is the caller graph for this function:

◆ GetSignals()

int sent_channel::GetSignals ( uint8_t *  pStat,
uint16_t *  pSig0,
uint16_t *  pSig1 
)

Definition at line 330 of file sent.cpp.

330  {
331  uint32_t rx;
332  int ret = GetMsg(&rx);
333 
334  if (ret < 0) {
335  return ret;
336  }
337 
338  /* NOTE different MSB packing for sig0 and sig1
339  * is it protocol-defined or device-specific?
340  * Also looks like some devices send 16 + 8 bit, not 12 + 12 */
341  if (pStat) {
342  *pStat = MsgGetStat(rx);
343  }
344 
345  if (pSig0) {
346  uint16_t tmp = MsgGetSig0(rx);
347  *pSig0 = tmp;
348  }
349 
350  if (pSig1) {
351  uint16_t tmp = MsgGetSig1(rx);
352  /* swap */
353  tmp = ((tmp >> 8) & 0x00f) |
354  ((tmp << 8) & 0xf00) |
355  (tmp & 0x0f0);
356  *pSig1 = tmp;
357  }
358 
359  return 0;
360 }
int GetMsg(uint32_t *rx)
Definition: sent.cpp:318

Referenced by Info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSlowChannelValue()

int sent_channel::GetSlowChannelValue ( uint8_t  id)

Definition at line 389 of file sent.cpp.

390 {
391  size_t i;
392 
393  for (i = 0; i < SENT_SLOW_CHANNELS_MAX; i++) {
394  if ((scMsgFlags & BIT(i)) && (scMsg[i].id == id)) {
395  return scMsg[i].data;
396  }
397  }
398 
399  /* not found */
400  return -1;
401 }
struct sent_channel::@47 scMsg[SENT_SLOW_CHANNELS_MAX]
uint16_t scMsgFlags
Definition: sent_logic.h:74

◆ getTickTime()

float sent_channel::getTickTime ( )

Definition at line 94 of file sent.cpp.

94  {
95  return tickPerUnit;
96 }

Referenced by Info().

Here is the caller graph for this function:

◆ Info()

void sent_channel::Info ( )

Definition at line 559 of file sent.cpp.

559  {
560  uint8_t stat;
561  uint16_t sig0, sig1;
562 
563  efiPrintf("Unit time %lu CPU ticks %f uS", tickPerUnit, TicksToUs(getTickTime()));
564  efiPrintf("Pause pulse detected %s", pausePulseReceived ? "Yes" : "No");
565  efiPrintf("Total pulses %lu", pulseCounter);
566 
567  if (GetSignals(&stat, &sig0, &sig1) == 0) {
568  efiPrintf("Last valid fast msg Status 0x%01x Sig0 0x%03x Sig1 0x%03x", stat, sig0, sig1);
569  }
570 
571  if (scMsgFlags) {
572  efiPrintf("Slow channels:");
573  for (int i = 0; i < SENT_SLOW_CHANNELS_MAX; i++) {
574  if (scMsgFlags & BIT(i)) {
575  efiPrintf(" ID %d: %d", scMsg[i].id, scMsg[i].data);
576  }
577  }
578  }
579 
580  #if SENT_STATISTIC_COUNTERS
581  efiPrintf("HW overflows %lu\n", statistic.hwOverflowCnt);
582 
583  efiPrintf("Pause pulses %lu\n", statistic.PauseCnt);
584  efiPrintf("Restarts %lu", statistic.RestartCnt);
585  efiPrintf("Interval errors %lu short, %lu long", statistic.ShortIntervalErr, statistic.LongIntervalErr);
586  efiPrintf("Total frames %lu with CRC error %lu (%f%%)", statistic.FrameCnt, statistic.CrcErrCnt, statistic.CrcErrCnt * 100.0 / statistic.FrameCnt);
587  efiPrintf("Total slow channel messages %lu with crc6 errors %lu (%f%%)", statistic.sc, statistic.scCrcErr, statistic.scCrcErr * 100.0 / statistic.sc);
588  efiPrintf("Sync errors %lu", statistic.SyncErr);
589  #endif
590 }
float getTickTime()
Definition: sent.cpp:94
int GetSignals(uint8_t *pStat, uint16_t *pSig0, uint16_t *pSig1)
Definition: sent.cpp:330
uint32_t scCrcErr
Definition: sent_logic.h:45
uint32_t RestartCnt
Definition: sent_logic.h:41
Here is the call graph for this function:

◆ isSyncPulse()

bool sent_channel::isSyncPulse ( uint32_t  clocks)
private

Definition at line 98 of file sent.cpp.

99 {
100  /* check if pulse looks like sync with allowed +/-20% deviation */
101  uint32_t syncClocks = (SENT_SYNC_INTERVAL + SENT_OFFSET_INTERVAL) * tickPerUnit;
102 
103  if (((100 * clocks) >= (syncClocks * 80)) &&
104  ((100 * clocks) <= (syncClocks * 120)))
105  return 1;
106 
107  return 0;
108 }

Referenced by FastChannelDecoder().

Here is the caller graph for this function:

◆ restart()

void sent_channel::restart ( )
private

Definition at line 64 of file sent.cpp.

64  {
66  pulseCounter = 0;
68  pausePulseReceived = false;
69  tickPerUnit = 0;
70 
71  /* reset slow channels */
73  scMsgFlags = 0;
74 
75  #if SENT_STATISTIC_COUNTERS
78  statistic.SyncErr = 0;
79  statistic.CrcErrCnt = 0;
80  statistic.FrameCnt = 0;
81  statistic.PauseCnt = 0;
82  statistic.sc = 0;
83  statistic.scCrcErr = 0;
85  #endif
86 }

Referenced by FastChannelDecoder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SlowChannelDecoder()

int sent_channel::SlowChannelDecoder ( )
private

Definition at line 403 of file sent.cpp.

404 {
405  /* bit 2 and bit 3 from status nibble are used to transfer short messages */
406  bool b2 = !!(MsgGetStat(rxLast) & BIT(2));
407  bool b3 = !!(MsgGetStat(rxLast) & BIT(3));
408 
409  /* shift in new data */
410  scShift2 = (scShift2 << 1) | b2;
411  scShift3 = (scShift3 << 1) | b3;
412  scCrcShift = (scCrcShift << 2) | ((uint32_t)b2 << 1) | b3;
413 
414  if (1) {
415  /* Short Serial Message format */
416 
417  /* 0b1000.0000.0000.0000? */
418  if ((scShift3 & 0xffff) == 0x8000) {
419  /* Done receiving */
420 
421  /* TODO: add crc check */
422 
423  uint8_t id = (scShift2 >> 12) & 0x0f;
424  uint16_t data = (scShift2 >> 4) & 0xff;
425 
426  return StoreSlowChannelValue(id, data);
427  }
428  }
429  if (1) {
430  /* Enhanced Serial Message format */
431 
432  /* 0b11.1111.0xxx.xx0x.xxx0 ? */
433  if ((scShift3 & 0x3f821) == 0x3f000) {
434  uint8_t id;
435 
436  uint8_t crc = (scShift2 >> 12) & 0x3f;
437  #if SENT_STATISTIC_COUNTERS
438  statistic.sc++;
439  #endif
440  if (crc == crc6(scCrcShift)) {
441  /* C-flag: configuration bit is used to indicate 16 bit format */
442  bool sc16Bit = !!(scShift3 & (1 << 10));
443  if (!sc16Bit) {
444  /* 12 bit message, 8 bit ID */
445  id = ((scShift3 >> 1) & 0x0f) |
446  ((scShift3 >> 2) & 0xf0);
447  uint16_t data = scShift2 & 0x0fff; /* 12 bit */
448 
449  /* TODO: add crc check */
450  return StoreSlowChannelValue(id, data);
451  } else {
452  /* 16 bit message, 4 bit ID */
453  id = (scShift3 >> 6) & 0x0f;
454  uint16_t data = (scShift2 & 0x0fff) |
455  (((scShift3 >> 1) & 0x0f) << 12);
456 
457  return StoreSlowChannelValue(id, data);
458  }
459  } else {
460  #if SENT_STATISTIC_COUNTERS
462  #endif
463  }
464  }
465  }
466 
467  return 0;
468 }
uint8_t crc6(uint32_t data)
Definition: sent.cpp:529
uint32_t scShift2
Definition: sent_logic.h:75
int StoreSlowChannelValue(uint8_t id, uint16_t data)
Definition: sent.cpp:362
uint32_t scCrcShift
Definition: sent_logic.h:77
uint8_t id
Definition: sent_logic.h:103
uint32_t scShift3
Definition: sent_logic.h:76

Referenced by Decoder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SlowChannelDecoderReset()

void sent_channel::SlowChannelDecoderReset ( )
private

Definition at line 470 of file sent.cpp.

471 {
472  /* packet is incorrect, reset slow channel state machine */
473  scShift2 = 0;
474  scShift3 = 0;
475 }

Referenced by Decoder(), and restart().

Here is the caller graph for this function:

◆ StoreSlowChannelValue()

int sent_channel::StoreSlowChannelValue ( uint8_t  id,
uint16_t  data 
)
private

Definition at line 362 of file sent.cpp.

363 {
364  size_t i;
365 
366  /* Update already allocated messagebox? */
367  for (i = 0; i < SENT_SLOW_CHANNELS_MAX; i++) {
368  if ((scMsgFlags & BIT(i)) && (scMsg[i].id == id)) {
369  scMsg[i].data = data;
370  return 0;
371  }
372  }
373 
374  /* New message? Allocate messagebox */
375  for (i = 0; i < SENT_SLOW_CHANNELS_MAX; i++) {
376  if (!(scMsgFlags & BIT(i)))
377  {
378  scMsg[i].data = data;
379  scMsg[i].id = id;
380  scMsgFlags |= (1 << i);
381  return 0;
382  }
383  }
384 
385  /* No free mailboxes for new ID */
386  return -1;
387 }

Referenced by SlowChannelDecoder().

Here is the caller graph for this function:

Field Documentation

◆ currentStatePulseCounter

uint32_t sent_channel::currentStatePulseCounter = 0
private

Definition at line 64 of file sent_logic.h.

Referenced by FastChannelDecoder(), and restart().

◆ data

uint16_t sent_channel::data

◆ hasValidFast

bool sent_channel::hasValidFast = false
private

Definition at line 69 of file sent_logic.h.

Referenced by FastChannelDecoder(), and GetMsg().

◆ id

uint8_t sent_channel::id

Definition at line 103 of file sent_logic.h.

Referenced by SlowChannelDecoder(), and StoreSlowChannelValue().

◆ pausePulseReceived

bool sent_channel::pausePulseReceived = false
private

Definition at line 65 of file sent_logic.h.

Referenced by FastChannelDecoder(), Info(), and restart().

◆ pulseCounter

uint32_t sent_channel::pulseCounter = 0
private

Definition at line 62 of file sent_logic.h.

Referenced by FastChannelDecoder(), Info(), and restart().

◆ rxLast

uint32_t sent_channel::rxLast
private

Definition at line 71 of file sent_logic.h.

Referenced by FastChannelDecoder(), GetMsg(), and SlowChannelDecoder().

◆ rxReg

uint32_t sent_channel::rxReg
private

Definition at line 68 of file sent_logic.h.

Referenced by FastChannelDecoder().

◆ scCrcShift

uint32_t sent_channel::scCrcShift
private

Definition at line 77 of file sent_logic.h.

Referenced by SlowChannelDecoder().

◆ 

struct { ... } sent_channel::scMsg[SENT_SLOW_CHANNELS_MAX]

◆ scMsgFlags

uint16_t sent_channel::scMsgFlags
private

Definition at line 74 of file sent_logic.h.

Referenced by GetSlowChannelValue(), Info(), restart(), and StoreSlowChannelValue().

◆ scShift2

uint32_t sent_channel::scShift2
private

Definition at line 75 of file sent_logic.h.

Referenced by SlowChannelDecoder(), and SlowChannelDecoderReset().

◆ scShift3

uint32_t sent_channel::scShift3
private

Definition at line 76 of file sent_logic.h.

Referenced by SlowChannelDecoder(), and SlowChannelDecoderReset().

◆ state

SENT_STATE_enum sent_channel::state = SENT_STATE_CALIB
private

Definition at line 58 of file sent_logic.h.

Referenced by FastChannelDecoder(), and restart().

◆ statistic

sent_channel_stat sent_channel::statistic

Definition at line 108 of file sent_logic.h.

Referenced by Decoder(), FastChannelDecoder(), Info(), restart(), and SlowChannelDecoder().

◆ tickPerUnit

uint32_t sent_channel::tickPerUnit = 0
private

The documentation for this class was generated from the following files: