Skip to content

Commit 42e2fcd

Browse files
Fixed new header cicsSpyStatusBits.h. (#218)
* Fixed new header cicsSpyStatusBits.h. Signed-off-by: David Rebbe <drebbe@intrepidcs.com> * fixed icsneoGetComponentVersions errors --------- Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent 91e62eb commit 42e2fcd

File tree

4 files changed

+349
-1108
lines changed

4 files changed

+349
-1108
lines changed

extract_icsneo40_defines.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
from __future__ import print_function
3+
from os import path
34
import os.path
45
import re
56
from subprocess import run, PIPE
@@ -78,15 +79,21 @@ def extract():
7879
with open("src/setup_module_auto_defines.cpp", "w") as f:
7980
print(boiler_plate, file=f)
8081
# Include the header files needed for the defines
81-
82-
print('#include "setup_module_auto_defines.h"\n#include <Python.h>\n#pragma warning(push, 0)\n#include "ics/icsnVC40.h"\n#pragma warning(pop)', file=f)
82+
83+
print(
84+
'#include "setup_module_auto_defines.h"\n#include <Python.h>\n#pragma warning(push, 0)\n#include "ics/icsnVC40.h"\n#pragma warning(pop)',
85+
file=f,
86+
)
8387
if use_internal:
8488
print('#pragma warning(push, 0)\n#include "ics/icsnVC40Internal.h"\n#pragma warning(pop)', file=f)
8589

8690
print("\nint setup_module_auto_defines(PyObject * module)\n{", file=f)
8791
print("\tint result = 0;\n", file=f)
8892
fnames = []
8993
fnames.append(format_file("include/ics/icsnVC40.h"))
94+
# Append cicsSpyStatusBits header included in v921
95+
if pathlib.Path("include/ics/cicsSpyStatusBits.h").exists():
96+
fnames.append(format_file("include/ics/cicsSpyStatusBits.h"))
9097
if use_internal:
9198
fnames.append(format_file("include/ics/icsnVC40Internal.h"))
9299
# Let's get to work here!

include/ics/cicsSpyStatusBits.h

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
// --------------------------------------------------------------------------
2+
// COPYRIGHT INTREPID CONTROL SYSTEMS, INC. (c) 1994-20xx
3+
// Confidential and proprietary. This document and its contents are the
4+
// property of Intrepid Control Systems, Inc. It is not to be copied,
5+
// distributed, or otherwise disclosed or used without the prior written
6+
// consent of Intrepid Control Systems Inc.
7+
// All rights reserved.
8+
// --------------------------------------------------------------------------
9+
10+
// SPY Status Bit Definitions
11+
// Generated automatically - DO NOT MODIFY
12+
// Modify cicsSpyStatusBits_config.yml and run cicsSpyStatusBits_gen.py
13+
// Generated on: 2025-07-14 14:31:40
14+
15+
16+
#ifndef CICSSPYSTATUSBITS_H_
17+
#define CICSSPYSTATUSBITS_H_ 1
18+
19+
// WARNING: The following bit conflicts were detected:
20+
// spystatus value 0x10000000: // VSI value 'SPY_STATUS_VSI_IFR_CRC_BIT' conflicts with common value 'SPY_STATUS_PDU'
21+
// spystatus value 0x10000000: // A2B value 'SPY_STATUS_A2B_CONTROL' conflicts with common value 'SPY_STATUS_PDU'
22+
// spystatus value 0x08: // A2B value 'SPY_STATUS_A2B_SCF_VALID_WAITING' conflicts with common value 'SPY_STATUS_REMOTE_FRAME'
23+
// spystatus value 0x40000000: // A2B value 'SPY_STATUS_A2B_UPSTREAM' conflicts with common value 'SPY_STATUS_HIGH_SPEED'
24+
// spystatus value 0x10000000: // FLEXRAY value 'SPY_STATUS_FLEXRAY_PDU' conflicts with common value 'SPY_STATUS_PDU'
25+
// spystatus value 0x40000000: // FLEXRAY value 'SPY_STATUS_FLEXRAY_PDU_UPDATE_BIT_SET' conflicts with common value 'SPY_STATUS_HIGH_SPEED'
26+
// spystatus value 0x08: // FLEXRAY value 'SPY_STATUS_FLEXRAY_PDU_NO_UPDATE_BIT' conflicts with common value 'SPY_STATUS_REMOTE_FRAME'
27+
28+
29+
// Glyph definitions
30+
// '|' - byte divider
31+
// '.' - nibble divider
32+
// '-' - unused bit
33+
// 'o' - common bit
34+
// 'x' - protocol specific bit
35+
// '!' - conflict bit
36+
37+
// SPYSTATUS bit definitions
38+
// SPYSTATUS - Common bits
39+
// |oo-o.oooo|oooo.oooo|oooo.oo-o|oo-o.oooo|
40+
#define SPY_STATUS_GLOBAL_ERR 0x01 // Global error flag
41+
#define SPY_STATUS_TX_MSG 0x02 // Transmitted message
42+
#define SPY_STATUS_XTD_FRAME 0x04 // Extended frame
43+
#define SPY_STATUS_REMOTE_FRAME 0x08 // Remote frame
44+
#define SPY_STATUS_CRC_ERROR 0x10 // CRC error
45+
#define SPY_STATUS_INCOMPLETE_FRAME 0x40 // Incomplete frame
46+
#define SPY_STATUS_LOST_ARBITRATION 0x80 // Lost arbitration
47+
#define SPY_STATUS_UNDEFINED_ERROR 0x0100 // Undefined error
48+
#define SPY_STATUS_BUS_RECOVERED 0x0400 // Bus recovered
49+
#define SPY_STATUS_BUS_SHORTED_PLUS 0x0800 // Bus shorted to plus
50+
#define SPY_STATUS_BUS_SHORTED_GND 0x1000 // Bus shorted to ground
51+
#define SPY_STATUS_CHECKSUM_ERROR 0x2000 // Checksum error
52+
#define SPY_STATUS_BAD_MESSAGE_BIT_TIME_ERROR 0x4000 // Bad message bit time error
53+
#define SPY_STATUS_TX_NOMATCH 0x8000 // TX no match
54+
#define SPY_STATUS_COMM_IN_OVERFLOW 0x010000 // Communication input overflow
55+
#define SPY_STATUS_EXPECTED_LEN_MISMATCH 0x020000 // Expected length mismatch
56+
#define SPY_STATUS_MSG_NO_MATCH 0x040000 // Message no match
57+
#define SPY_STATUS_BREAK 0x080000 // Break detected
58+
#define SPY_STATUS_AVSI_REC_OVERFLOW 0x100000 // AVSI record overflow
59+
#define SPY_STATUS_TEST_TRIGGER 0x200000 // Test trigger
60+
#define SPY_STATUS_AUDIO_COMMENT 0x400000 // Audio comment
61+
#define SPY_STATUS_GPS_DATA 0x800000 // GPS data
62+
#define SPY_STATUS_ANALOG_DIGITAL_INPUT 0x01000000 // Analog digital input
63+
#define SPY_STATUS_TEXT_COMMENT 0x02000000 // Text comment
64+
#define SPY_STATUS_NETWORK_MESSAGE_TYPE 0x04000000 // Network message type
65+
#define SPY_STATUS_VSI_TX_UNDERRUN 0x08000000 // VSI TX underrun
66+
#define SPY_STATUS_PDU 0x10000000 // PDU message
67+
#define SPY_STATUS_HIGH_SPEED 0x40000000 // High speed
68+
#define SPY_STATUS_EXTENDED 0x80000000 // Extended - if this bit is set than decode StatusBitField3 in AckBytes
69+
70+
// SPYSTATUS - A2B protocol bits
71+
// |o!x!.oooo|oooo.oooo|oooo.oo-o|oo-o.!ooo|
72+
#define SPY_STATUS_A2B_SCF_VALID_WAITING 0x08 // A2B SCF valid waiting
73+
#define SPY_STATUS_A2B_CONTROL 0x10000000 // A2B control message
74+
#define SPY_STATUS_A2B_MONITOR 0x20000000 // A2B monitor message
75+
#define SPY_STATUS_A2B_UPSTREAM 0x40000000 // A2B upstream message
76+
77+
// SPYSTATUS - CAN protocol bits
78+
// |ooxo.oooo|oooo.oooo|oooo.ooxo|ooxo.oooo|
79+
#define SPY_STATUS_CAN_ERROR_PASSIVE 0x20 // CAN error passive state
80+
#define SPY_STATUS_CAN_BUS_OFF 0x0200 // CAN bus off state
81+
#define SPY_STATUS_CANFD 0x20000000 // CAN FD frame
82+
83+
// SPYSTATUS - ETHERNET protocol bits
84+
// |oo-o.oooo|oooo.oooo|oooo.oo-o|ooxo.oooo|
85+
#define SPY_STATUS_HEADERCRC_ERROR 0x20 // Header CRC error
86+
87+
// SPYSTATUS - FLEXRAY protocol bits
88+
// |o!-!.oooo|oooo.oooo|oooo.oo-o|oo-o.!ooo|
89+
#define SPY_STATUS_FLEXRAY_PDU_NO_UPDATE_BIT 0x08 // FlexRay PDU no update bit
90+
#define SPY_STATUS_FLEXRAY_PDU 0x10000000 // FlexRay PDU (alias for SPY_STATUS_PDU)
91+
#define SPY_STATUS_FLEXRAY_PDU_UPDATE_BIT_SET 0x40000000 // FlexRay PDU update bit set
92+
93+
// SPYSTATUS - LIN protocol bits
94+
// |ooxo.oooo|oooo.oooo|oooo.oo-o|oo-o.oooo|
95+
#define SPY_STATUS_LIN_MASTER 0x20000000 // LIN master message
96+
97+
// SPYSTATUS - VSI protocol bits
98+
// |oox!.oooo|oooo.oooo|oooo.oo-o|oo-o.oooo|
99+
#define SPY_STATUS_VSI_IFR_CRC_BIT 0x10000000 // VSI IFR CRC bit
100+
#define SPY_STATUS_INIT_MESSAGE 0x20000000 // Initialization message
101+
102+
103+
// SPYSTATUS2 bit definitions
104+
// SPYSTATUS2 - Common bits
105+
// |----.----|---o.--oo|----.----|----.oooo|
106+
#define SPY_STATUS2_HAS_VALUE 0x01
107+
#define SPY_STATUS2_VALUE_IS_BOOLEAN 0x02
108+
#define SPY_STATUS2_HIGH_VOLTAGE 0x04
109+
#define SPY_STATUS2_LONG_MESSAGE 0x08
110+
#define SPY_STATUS2_GLOBAL_CHANGE 0x010000
111+
#define SPY_STATUS2_ERROR_FRAME 0x020000
112+
#define SPY_STATUS2_END_OF_LONG_MESSAGE 0x100000
113+
114+
// SPYSTATUS2 - CAN protocol bits
115+
// |----.----|-xxo.--oo|----.----|----.oooo|
116+
#define SPY_STATUS2_CAN_ISO15765_LOGICAL_FRAME 0x200000
117+
#define SPY_STATUS2_CAN_HAVE_LINK_DATA 0x400000
118+
119+
// SPYSTATUS2 - ETHERNET protocol bits
120+
// |xxxx.xxxx|xxxo.--oo|----.----|----.oooo|
121+
#define SPY_STATUS2_ETHERNET_CRC_ERROR 0x200000
122+
#define SPY_STATUS2_ETHERNET_FRAME_TOO_SHORT 0x400000
123+
#define SPY_STATUS2_ETHERNET_FCS_AVAILABLE 0x800000 // This frame contains FCS (4 bytes) obtained from ICS Ethernet hardware (ex. RAD-STAR)
124+
#define SPY_STATUS2_ETHERNET_NO_PADDING 0x01000000
125+
#define SPY_STATUS2_ETHERNET_PREEMPTION_ENABLED 0x02000000
126+
#define SPY_STATUS2_ETHERNET_UPDATE_CHECKSUMS 0x04000000
127+
#define SPY_STATUS2_ETHERNET_MANUALFCS_ENABLED 0x08000000
128+
#define SPY_STATUS2_ETHERNET_FCS_VERIFIED 0x10000000
129+
#define SPY_STATUS2_ETHERNET_T1S_SYMBOL 0x20000000
130+
#define SPY_STATUS2_ETHERNET_T1S_BURST 0x40000000
131+
#define SPY_STATUS2_ETHERNET_T1S_ETHERNET 0x80000000
132+
133+
// SPYSTATUS2 - FLEXRAY protocol bits
134+
// |----.-xxx|xxxo.--oo|----.----|----.oooo|
135+
#define SPY_STATUS2_FLEXRAY_TX_AB 0x200000
136+
#define SPY_STATUS2_FLEXRAY_TX_AB_NO_A 0x400000
137+
#define SPY_STATUS2_FLEXRAY_TX_AB_NO_B 0x800000
138+
#define SPY_STATUS2_FLEXRAY_TX_AB_NO_MATCH 0x01000000
139+
#define SPY_STATUS2_FLEXRAY_NO_CRC 0x02000000
140+
#define SPY_STATUS2_FLEXRAY_NO_HEADERCRC 0x04000000 //
141+
142+
// SPYSTATUS2 - I2C protocol bits
143+
// |----.----|xxxo.--oo|----.----|----.oooo|
144+
#define SPY_STATUS2_I2C_ERR_TIMEOUT 0x200000
145+
#define SPY_STATUS2_I2C_ERR_NACK 0x400000
146+
#define SPY_STATUS2_I2C_DIR_READ 0x800000
147+
148+
// SPYSTATUS2 - ISO protocol bits
149+
// |-xxx.x---|---o.--oo|----.----|----.oooo|
150+
#define SPY_STATUS2_ISO_FRAME_ERROR 0x08000000 // ISO frame error
151+
#define SPY_STATUS2_ISO_OVERFLOW_ERROR 0x10000000 // ISO overflow error
152+
#define SPY_STATUS2_ISO_PARITY_ERROR 0x20000000 // ISO parity error
153+
#define SPY_STATUS2_ISO_RX_TIMEOUT_ERROR 0x40000000 // ISO specific timeout error
154+
155+
// SPYSTATUS2 - LIN protocol bits
156+
// |xxxx.xxxx|xxxo.--oo|----.----|----.oooo|
157+
#define SPY_STATUS2_LIN_ERR_RX_BREAK_NOT_0 0x200000 // LIN RX break not 0 error
158+
#define SPY_STATUS2_LIN_ERR_RX_BREAK_TOO_SHORT 0x400000 // LIN RX break too short error
159+
#define SPY_STATUS2_LIN_ERR_RX_SYNC_NOT_55 0x800000 // LIN RX sync not 0x55 error
160+
#define SPY_STATUS2_LIN_ERR_RX_DATA_GREATER_8 0x01000000 // LIN RX data greater than 8 bytes error
161+
#define SPY_STATUS2_LIN_ERR_TX_RX_MISMATCH 0x02000000 // LIN TX/RX mismatch error
162+
#define SPY_STATUS2_LIN_ERR_MSG_ID_PARITY 0x04000000 // LIN message ID parity error
163+
#define SPY_STATUS2_LIN_SYNC_FRAME_ERROR 0x08000000 // LIN sync frame error
164+
#define SPY_STATUS2_LIN_ID_FRAME_ERROR 0x10000000 // LIN ID frame error
165+
#define SPY_STATUS2_LIN_SLAVE_BYTE_ERROR 0x20000000 // LIN slave byte error
166+
#define SPY_STATUS2_LIN_RX_TIMEOUT_ERROR 0x40000000 // RX timeout error
167+
#define SPY_STATUS2_LIN_NO_SLAVE_DATA 0x80000000 // LIN no slave data
168+
169+
// SPYSTATUS2 - MDIO protocol bits
170+
// |-xxx.xxxx|xxxo.--oo|----.----|----.oooo|
171+
#define SPY_STATUS2_MDIO_ERR_TIMEOUT 0x200000
172+
#define SPY_STATUS2_MDIO_JOB_CANCELLED 0x400000
173+
#define SPY_STATUS2_MDIO_INVALID_BUS 0x800000
174+
#define SPY_STATUS2_MDIO_INVALID_PHYADDR 0x01000000
175+
#define SPY_STATUS2_MDIO_INVALID_REGADDR 0x02000000
176+
#define SPY_STATUS2_MDIO_UNSUPPORTED_CLAUSE 0x04000000
177+
#define SPY_STATUS2_MDIO_UNSUPPORTED_OPCODE 0x08000000
178+
#define SPY_STATUS2_MDIO_OVERFLOW 0x10000000
179+
#define SPY_STATUS2_MDIO_CLAUSE45 0x20000000
180+
#define SPY_STATUS2_MDIO_READ 0x40000000
181+
182+
// SPYSTATUS2 - MOST protocol bits
183+
// |xxxx.xxxx|xxxo.--oo|----.----|----.oooo|
184+
#define SPY_STATUS2_MOST_PACKET_DATA 0x200000
185+
#define SPY_STATUS2_MOST_STATUS 0x400000 // reflects changes in light/lock/MPR/SBC/etc...
186+
#define SPY_STATUS2_MOST_LOW_LEVEL 0x800000 // MOST low level message, allocs, deallocs, remote requests...*/
187+
#define SPY_STATUS2_MOST_CONTROL_DATA 0x01000000
188+
#define SPY_STATUS2_MOST_MHP_USER_DATA 0x02000000 // MOST HIGH User Data Frame
189+
#define SPY_STATUS2_MOST_MHP_CONTROL_DATA 0x04000000 // MOST HIGH Control Data
190+
#define SPY_STATUS2_MOST_I2S_DUMP 0x08000000
191+
#define SPY_STATUS2_MOST_TOO_SHORT 0x10000000
192+
#define SPY_STATUS2_MOST_MOST50 0x20000000 // absence of MOST50 and MOST150 implies it's MOST25
193+
#define SPY_STATUS2_MOST_MOST150 0x40000000
194+
#define SPY_STATUS2_MOST_CHANGED_PAR 0x80000000 // first byte in ack reflects what changed.
195+
196+
// SPYSTATUS2 - WBMS protocol bits
197+
// |----.----|--xo.--oo|----.----|----.oooo|
198+
#define SPY_STATUS2_WBMS_API_IS_CALLBACK 0x200000
199+
200+
201+
// SPYSTATUS3 bit definitions
202+
// SPYSTATUS3 - CAN protocol bits
203+
// |----.----|-xxx.xxxx|-xxx.xxxx|----.-xxx|
204+
#define SPY_STATUS3_CAN_ERR_PASSIVE 0x01 // CAN error passive state: typically when error counter is > 127
205+
#define SPY_STATUS3_CAN_BUS_OFF 0x02 // CAN bus off state
206+
#define SPY_STATUS3_CAN_ERR_WARNING 0x04 // CAN error warning: typically when error counter is > 96
207+
#define SPY_STATUS3_CAN_DATAERR_STUFF_ERROR 0x0100 // CAN stuff error during the data payload phase
208+
#define SPY_STATUS3_CAN_DATAERR_FORM_ERROR 0x0200 // CAN form error during the data payload phase
209+
#define SPY_STATUS3_CAN_DATAERR_ACK_ERROR 0x0400 // CAN ack error during the data payload phase
210+
#define SPY_STATUS3_CAN_DATAERR_BIT1_ERROR 0x0800 // CAN bit1 error during the data payload phase
211+
#define SPY_STATUS3_CAN_DATAERR_BIT0_ERROR 0x1000 // CAN bit0 error during the data payload phase
212+
#define SPY_STATUS3_CAN_DATAERR_CRC_ERROR 0x2000 // CAN CRC error during the data payload phase
213+
#define SPY_STATUS3_CAN_DATAERR_NOCHANGE 0x4000 // CAN data error occurred before and no change yet
214+
#define SPY_STATUS3_CAN_GENERR_STUFF_ERROR 0x010000 // CAN stuff error at the general frame level
215+
#define SPY_STATUS3_CAN_GENERR_FORM_ERROR 0x020000 // CAN form error at the general frame level
216+
#define SPY_STATUS3_CAN_GENERR_ACK_ERROR 0x040000 // CAN ack error at the general frame level
217+
#define SPY_STATUS3_CAN_GENERR_BIT1_ERROR 0x080000 // CAN bit1 error at the general frame level
218+
#define SPY_STATUS3_CAN_GENERR_BIT0_ERROR 0x100000 // CAN bit0 error at the general frame level
219+
#define SPY_STATUS3_CAN_GENERR_CRC_ERROR 0x200000 // CAN CRC error at the general frame level
220+
#define SPY_STATUS3_CAN_GENERR_NOCHANGE 0x400000 // CAN frame Error occurred before and no change yet
221+
222+
// SPYSTATUS3 - CANFD protocol bits
223+
// |----.----|----.----|----.----|---x.xxxx|
224+
#define SPY_STATUS3_CANFD_ESI 0x01 // CAN FD Error State Indicator (ESI) reflects the error state of the transmitting node
225+
#define SPY_STATUS3_CANFD_IDE 0x02 // CAN FD Identifier Extension (IDE) indicates if standard or extended IDs are in use
226+
#define SPY_STATUS3_CANFD_RTR 0x04
227+
#define SPY_STATUS3_CANFD_FDF 0x08 // CAN FD Format (FDF) flag -- distinguishes classic CAN from CANFD
228+
#define SPY_STATUS3_CANFD_BRS 0x10 // CANFD Baud Rate Select (BRS) flag, indicates if the data portion transmits at a higher bitrate
229+
230+
// SPYSTATUS3 - ETHERNET protocol bits
231+
// |----.----|----.----|----.----|----.--xx|
232+
#define SPY_STATUS3_ETHERNET_TX_COLLISION 0x01
233+
#define SPY_STATUS3_ETHERNET_T1S_WAKE 0x02
234+
235+
// SPYSTATUS3 - LIN protocol bits
236+
// |----.----|----.----|----.----|----.-xxx|
237+
#define SPY_STATUS3_LIN_JUST_BREAK_SYNC 0x01
238+
#define SPY_STATUS3_LIN_SLAVE_DATA_TOO_SHORT 0x02
239+
#define SPY_STATUS3_LIN_ONLY_UPDATE_SLAVE_TABLE_ONCE 0x04
240+
241+
242+
// SPYSTATUS4 bit definitions
243+
// SPYSTATUS4 - ETHERNET protocol bits
244+
// |----.----|----.----|----.----|----.--xx|
245+
#define SPY_STATUS4_ETH_CRC_ERROR 0x01 // Ethernet CRC error
246+
#define SPY_STATUS4_ETH_FRAME_TOO_LONG 0x02 // Ethernet frame too long
247+
248+
249+
#endif // CICSSPYSTATUSBITS_H_

0 commit comments

Comments
 (0)