diff --git a/README.rst b/README.rst
index 347f4e7..5492b8d 100644
--- a/README.rst
+++ b/README.rst
@@ -26,7 +26,7 @@ Building the documentation locally:
To build the documentation locally, you need to have Python and pip installed on your system.
You can install the required dependencies by running the following command:
-pip install -r requirements.txt
+pip install -r docs/requirements.txt
After installing the dependencies, you can build the documentation by running the following command:
diff --git a/docs/source/_static/images/safety_controller_states.svg b/docs/source/_static/images/safety_controller_states.svg
new file mode 100644
index 0000000..57d58a3
--- /dev/null
+++ b/docs/source/_static/images/safety_controller_states.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/source/_static/images/system_architecture.svg b/docs/source/_static/images/system_architecture.svg
new file mode 100644
index 0000000..096d4bd
--- /dev/null
+++ b/docs/source/_static/images/system_architecture.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/source/hardware.rst b/docs/source/hardware.rst
index 0912d18..780576f 100644
--- a/docs/source/hardware.rst
+++ b/docs/source/hardware.rst
@@ -99,11 +99,114 @@ in the following table.
| Stopbits | 1 |
+-----------------+-------------+
+System Architecture
+===================
+.. figure:: _static/images/system_architecture.svg
+ :width: 1000pt
+
+ Figure: Simplified system architecture for the safety controller on the chargeSOM
+
+The safety controller manages the Control Pilot (CP) line, acting as a critical interface for monitoring and controlling the high-voltage (HV) system in accordance with EV safety standards. Its core function is to **enforce safe operating states** based on system diagnostics and environmental conditions.
+
+Fault Detection & Safety Response
+---------------------------------
+
+When an error is detected—such as a fault in the system, a triggered emergency input, or a thermal violation—the controller transitions to **State F**, a fail-safe state that prevents further system operation to protect both the hardware and the user.
+
+HV Ready Enablement
+-------------------
+
+The controller verifies that **no system errors are present** and that the CP line is in **State C**. Only under these safe conditions does it enable the HV Ready signal, which may be used to energize the HV interlock or permit charging/operation.
+
+Emergency Inputs
+----------------------------------
+
+The simplified system architecture shows only one emergency input. In the real system, there are 3 independent emergency input signals available: SAFETY_ESTOP1, SAFETY_ESTOP2 and SAFETY_ESTOP3. The inputs are active low. This means an emergency stop needs to pull the input to Gnd. The emergency inputs can be parameterized out.
+
+
+Temperature Monitoring
+----------------------------------
+
+The simplified system architecture shows only one temperature input. In the real system, there are 4 independent temperature measurement circuits for PT1000 sensors. The safety software monitors the temperature circuit for hardware errors and for overtemperaure. The temperature threshold can be parameterized.
+
+HV Connector Control
+--------------------
+
+If State C is confirmed and all safety criteria are met, the controller is also capable of closing HV connectors to complete the high-voltage path. Therefore it enables the 2 connectors SAFETY_HVSW1_HS and SAFETY_HVSW2_HS under the condition that State C is detected, the system is HV-ready and the host processor commands to close the contactors.
+
+
+Reset Behaviour and Controller states
+=====================================
+The safety controller starts in an initialization state, to give the peripherals time to reach an defined state. It leaves the initialization state to a running state, after the reception of the first UART message from the host. Only periodic messages leaves the init state. With the reception of inquiriy messages, the safety controller stays in initialization. This gives the option to fetch version information in an init state. In running state, it monitors the peripherals and sends out UART messages. If any error occurs, the system goes into safe state. This state can only be left by a reset.
+
+.. figure:: _static/images/safety_controller_states.svg
+ :width: 1000pt
+
+
Safety Controller Communication Protocol
========================================
-TBD
+Packet format descriptions
+--------------------------
+
+Data packet format
+
+Data packets contain payload and can be sent out from host to safety controller or vice versa. Data packets from safety controller to host can be transmitted periodically or by request via an inquiry packet. Only one inquiry packet can be requested before requesting the next one.
+
++--------+--------+--------+-------------------+
+| Symbol | Size | Code | Description |
++========+========+========+===================+
+| SOF | 1 byte | 0xA5 | Start of frame |
++--------+--------+--------+-------------------+
+| ID | 1 byte | | Packet Identifier |
++--------+--------+--------+-------------------+
+| Data | 8 byte | | Payload |
++--------+--------+--------+-------------------+
+| CRC | 1 byte | | CRC checksum |
++--------+--------+--------+-------------------+
+| EOF | 1 byte | 0x03 | End of frame |
++--------+--------+--------+-------------------+
+
+
+Packet Identifier (ID)
+----------------------
+
+The values of the packet identifier (PacketId) are mapped to the messages as summarized below.
+
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+| PacketId | Description | Communication Dir. | Periodicity | Triggered by Inquiry |
++==========+===========================+=====================+=============================================================+======================+
+| 0x06 | Charge Control | Host → Safety | periodically, every 100ms OR immediately if changes occur | No |
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+| 0x07 | Charge State | Safety → Host | periodically, every 100ms | No |
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+| 0x08 | PT1000 State | Safety → Host | periodically, every 100ms | No |
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+| 0x0A | Firmware Version | Safety → Host | no, only upon request via inquiry packet | Yes |
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+| 0x0B | GIT Hash | Safety → Host | no, only upon request via inquiry packet | Yes |
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+| 0xFF | Inquiry packet | Host → Safety | no, only to trigger inquiries | No |
++----------+---------------------------+---------------------+-------------------------------------------------------------+----------------------+
+
+CRC checksum field
+------------------
+
+The checksum is defined over:
+
+::
+
+ Width = 8
+ Poly = 0x1d
+ XorIn = 0xff
+ ReflectIn = False
+ XorOut = 0xff
+ ReflectOut = False
+ Algorithm = table-driven
+ Name = CRC8 SAE J1850
+
+.. include:: safety_protocol.rst
EVerest Board Support Package Module
diff --git a/docs/source/safety_protocol.rst b/docs/source/safety_protocol.rst
new file mode 100644
index 0000000..b4ffd36
--- /dev/null
+++ b/docs/source/safety_protocol.rst
@@ -0,0 +1,719 @@
+ChargeControl1
+==============
+
+**ID**: 0x6 (6)
+
+**Length**: 8 bytes
+
+**Description**: This message shall be sent from the host processor to the safety controller to control the peripherals connected to the safety controller.
+
+**Senders**: Default_HostController
+
+.. list-table:: Signals in ChargeControl1
+ :widths: 30 6 6 10 7 7 7 6 30
+ :header-rows: 1
+
+ * - Name
+ - Start
+ - Length
+ - ByteOrder
+ - Signed
+ - Factor
+ - Offset
+ - Unit
+ - Description
+ * - CC_TargetDutyCycle
+ - 1
+ - 10
+ - Big Endian
+ - No
+ - 0.1
+ - 0
+ - %
+ - Duty cycle between 0.0 and 100.0%. Values above 100.0% are set as 100%. Only valid if the signal CC_PWM_Active is 1
+ * - CC_PWM_Active
+ - 7
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - This flag indicates if the PWM should be activated. At a value of 0, the CP level is also 0V. At a value of 1, the CP level is dependant of the duty cycle
+ * - CC_Contactor1State
+ - 16
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Request to close the contactor state. A value of 0 means open contactor, a value of 1 means closed contactor. The contactors are only closed if the system has no errors and is in state C.
+ * - CC_Contactor2State
+ - 17
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Request to close the contactor state. A value of 0 means open contactor, a value of 1 means closed contactor. The contactors are only closed if the system has no errors and is in state C.
+
+**Bitfield Layout**
+
+::
+
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 0| CC_PWM_Active | | | | | | CC_TargetDutyCycle | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 1| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 2| | | | | | | CC_Contactor2State | CC_Contactor1State |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 3| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 4| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 5| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 6| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 7| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+
+ChargeState1
+============
+
+**ID**: 0x7 (7)
+
+**Length**: 8 bytes
+
+**Description**: This message shall be sent from safety controller to host processor for indicating the state of the charging session as well as the state of connected peripherals.
+
+**Senders**: Safety Controller
+
+.. list-table:: Signals in ChargeState1
+ :widths: 30 6 6 10 7 7 7 6 30
+ :header-rows: 1
+
+ * - Name
+ - Start
+ - Length
+ - ByteOrder
+ - Signed
+ - Factor
+ - Offset
+ - Unit
+ - Description
+ * - CS_CurrentDutyCycle
+ - 1
+ - 10
+ - Big Endian
+ - No
+ - 0.1
+ - 0
+ - %
+ - The current duty cycle between 0.0% and 100.0%. If the PWM is not aczive this signal is 0
+ * - CS_PWM_Active
+ - 7
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Feedback if PWM is active. 0 means not active, 1 means active
+ * - CS_CurrentCpState
+ - 18
+ - 3
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Current state of the control pilot. See value mappings below
+ * - CS_CpShortCircuit
+ - 19
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Is set when the safety controller detects a short-circuit condition between CP and PE line.
+ * - CS_DiodeFault
+ - 20
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Is set when the safety controller detects that the diode on EV side is missing.
+ * - CS_CurrentPpState
+ - 26
+ - 3
+ -
+ - No
+ - 1
+ - 0
+ -
+ - State of the proximity pin. For fixed cables at CCS2, this value is 0x0: No Cable detected
+ * - CS_Contactor1State
+ - 33
+ - 2
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Is set when the contactor is closed
+ * - CS_Contactor1Error
+ - 34
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Is set when an error in the contactor is detected
+ * - CS_Contactor2State
+ - 36
+ - 2
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Is set when the contactor is closed
+ * - CS_Contactor2Error
+ - 37
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Is set when an error in the contactor is detected
+ * - CS_HV_Ready
+ - 38
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - This is the state of the HV ready or State C output. This output is high, if the chargeSOM dont see any errors and CP is at state C. Otherwise it is low.
+ * - CS_Estop1ChargingAbort
+ - 41
+ - 2
+ -
+ - No
+ - 1
+ - 0
+ -
+ - *No description available*
+ * - CS_Estop2ChargingAbort
+ - 43
+ - 2
+ -
+ - No
+ - 1
+ - 0
+ -
+ - *No description available*
+ * - CS_Estop3ChargingAbort
+ - 45
+ - 2
+ -
+ - No
+ - 1
+ - 0
+ -
+ - *No description available*
+
+**Value Descriptions**
+
+- **CS_CurrentCpState**
+
+ - 0x0 = Unknown
+ - 0x1 = A
+ - 0x2 = B
+ - 0x3 = C
+ - 0x4 = D
+ - 0x5 = E
+ - 0x6 = F
+ - 0x7 = Invalid
+
+- **CS_CurrentPpState**
+
+ - 0x0 = NoCableDetected
+ - 0x1 = 13A
+ - 0x2 = 20A
+ - 0x3 = 32A
+ - 0x4 = 63/70A
+ - 0x5 = Type1_Connected
+ - 0x6 = Type1_ConnectedButtonPressed
+ - 0x7 = Error
+
+- **CS_Contactor1State**
+
+ - 0x0 = OPEN
+ - 0x1 = CLOSE
+ - 0x3 = NotConfigured
+
+- **CS_Contactor2State**
+
+ - 0x0 = OPEN
+ - 0x1 = CLOSE
+ - 0x3 = NotConfigured
+
+- **CS_Estop1ChargingAbort**
+
+ - 0x0 = FALSE
+ - 0x1 = TRUE
+ - 0x3 = NotConfigured
+
+- **CS_Estop2ChargingAbort**
+
+ - 0x0 = FALSE
+ - 0x1 = TRUE
+ - 0x3 = NotConfigured
+
+- **CS_Estop3ChargingAbort**
+
+ - 0x0 = FALSE
+ - 0x1 = TRUE
+ - 0x3 = NotConfigured
+
+**Bitfield Layout**
+
+::
+
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 0| CS_PWM_Active | | | | | |CS_CurrentDutyCycle | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 1| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 2| | | | CS_DiodeFault | CS_CpShortCircuit | CS_CurrentCpState | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 3| | | | | | CS_CurrentPpState | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 4| | CS_HV_Ready | CS_Contactor2Error | CS_Contactor2State | | CS_Contactor1Error | CS_Contactor1State | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 5| | |CS_Estop3ChargingAbo| |CS_Estop2ChargingAbo| |CS_Estop1ChargingAbo| |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 6| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 7| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+
+PT1000State
+===========
+
+**ID**: 0x8 (8)
+
+**Length**: 8 bytes
+
+**Description**: This message shall be sent from safety controller to host processor for indicating the state of the connected temperature sensors
+
+**Senders**: Safety Controller
+
+.. list-table:: Signals in PT1000State
+ :widths: 30 6 6 10 7 7 7 6 30
+ :header-rows: 1
+
+ * - Name
+ - Start
+ - Length
+ - ByteOrder
+ - Signed
+ - Factor
+ - Offset
+ - Unit
+ - Description
+ * - PT1_Temperature
+ - 7
+ - 14
+ - Big Endian
+ - Yes
+ - 0.1
+ - 0
+ - °C
+ - Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.
+ * - PT1_ChargingStopped
+ - 8
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.
+ * - PT1_SelftestFailed
+ - 9
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.
+ * - PT2_Temperature
+ - 23
+ - 14
+ - Big Endian
+ - Yes
+ - 0.1
+ - 0
+ - °C
+ - Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.
+ * - PT2_ChargingStopped
+ - 24
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.
+ * - PT2_SelftestFailed
+ - 25
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.
+ * - PT3_Temperature
+ - 39
+ - 14
+ - Big Endian
+ - Yes
+ - 0.1
+ - 0
+ - °C
+ - Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.
+ * - PT3_ChargingStopped
+ - 40
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.
+ * - PT3_SelftestFailed
+ - 41
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.
+ * - PT4_Temperature
+ - 55
+ - 14
+ - Big Endian
+ - Yes
+ - 0.1
+ - 0
+ - °C
+ - Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.
+ * - PT4_ChargingStopped
+ - 56
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.
+ * - PT4_SelftestFailed
+ - 57
+ - 1
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.
+
+**Value Descriptions**
+
+- **PT1_Temperature**
+
+ - 0x1FFF = TempSensorNotUsed
+
+- **PT2_Temperature**
+
+ - 0x1FFF = TempSensorNotUsed
+
+- **PT3_Temperature**
+
+ - 0x1FFF = TempSensorNotUsed
+
+- **PT4_Temperature**
+
+ - 0x1FFF = TempSensorNotUsed
+
+**Bitfield Layout**
+
+::
+
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 0| PT1_Temperature | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 1| PT2_Temperature | | | | | | PT1_SelftestFailed |PT1_ChargingStopped |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 2| PT2_Temperature | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 3| PT3_Temperature | | | | | | PT2_SelftestFailed |PT2_ChargingStopped |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 4| PT3_Temperature | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 5| PT4_Temperature | | | | | | PT3_SelftestFailed |PT3_ChargingStopped |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 6| PT4_Temperature | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 7| | | | | | | PT4_SelftestFailed |PT4_ChargingStopped |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+
+FirmwareVersion
+===============
+
+**ID**: 0xA (10)
+
+**Length**: 8 bytes
+
+**Description**: This message provides information about the type and version of the flashed firmware
+
+**Senders**: Safety Controller
+
+.. list-table:: Signals in FirmwareVersion
+ :widths: 30 6 6 10 7 7 7 6 30
+ :header-rows: 1
+
+ * - Name
+ - Start
+ - Length
+ - ByteOrder
+ - Signed
+ - Factor
+ - Offset
+ - Unit
+ - Description
+ * - MajorVersion
+ - 7
+ - 8
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Major version of the firmware
+ * - MinorVersion
+ - 15
+ - 8
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Minor version of the firmware
+ * - BuildVersion
+ - 23
+ - 8
+ -
+ - No
+ - 1
+ - 0
+ -
+ - Build or patch version of the firmware
+ * - PlatformType
+ - 31
+ - 8
+ -
+ - No
+ - 1
+ - 0
+ -
+ - This firmware can be used for several products with minor changes in the build process. The platform type describes the used platform
+ * - ApplicationType
+ - 39
+ - 8
+ -
+ - No
+ - 1
+ - 0
+ -
+ - The type of firmware. See possible values below
+
+**Value Descriptions**
+
+- **PlatformType**
+
+ - 0x81 = chargeSOM
+ - 0x82 = CCY
+
+- **ApplicationType**
+
+ - 0x3 = Firmware
+ - 0x4 = End Of Line
+ - 0x5 = Qualification
+
+**Bitfield Layout**
+
+::
+
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 0| MajorVersion | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 1| MinorVersion | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 2| BuildVersion | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 3| PlatformType | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 4| ApplicationType | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 5| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 6| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 7| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+
+GitHash
+=======
+
+**ID**: 0xB (11)
+
+**Length**: 8 bytes
+
+**Description**: This message provides information about the GIT hash, written in the firmware
+
+**Senders**: Safety Controller
+
+.. list-table:: Signals in GitHash
+ :widths: 30 6 6 10 7 7 7 6 30
+ :header-rows: 1
+
+ * - Name
+ - Start
+ - Length
+ - ByteOrder
+ - Signed
+ - Factor
+ - Offset
+ - Unit
+ - Description
+ * - HashSignal
+ - 7
+ - 64
+ - Big Endian
+ - No
+ - 1
+ - 0
+ -
+ - First 8 byte of the 160 bit (SHA-1) GIT hash
+
+**Bitfield Layout**
+
+::
+
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 0| HashSignal | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 1| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 2| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 3| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 4| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 5| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 6| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 7| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+
+InquiryPacket
+=============
+
+**ID**: 0xFF (255)
+
+**Length**: 8 bytes
+
+**Description**: This packet is used to request a special message from the safety controller
+
+**Senders**: Default_HostController, CCY_HostController
+
+.. list-table:: Signals in InquiryPacket
+ :widths: 30 6 6 10 7 7 7 6 30
+ :header-rows: 1
+
+ * - Name
+ - Start
+ - Length
+ - ByteOrder
+ - Signed
+ - Factor
+ - Offset
+ - Unit
+ - Description
+ * - PacketId
+ - 7
+ - 8
+ -
+ - No
+ - 1
+ - 0
+ -
+ - The ID, which message shall be requested. Supported values are described below.
+
+**Value Descriptions**
+
+- **PacketId**
+
+ - 0xA = FirmwareVersion
+ - 0xB = GitHash
+
+**Bitfield Layout**
+
+::
+
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 0| PacketId | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 1| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 2| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 3| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 4| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 5| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 6| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+ 7| | | | | | | | |
+ +--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+--------------------+
+
diff --git a/docs/source/utils/Images.pptx b/docs/source/utils/Images.pptx
new file mode 100644
index 0000000..1a39c9e
Binary files /dev/null and b/docs/source/utils/Images.pptx differ
diff --git a/docs/source/utils/dbc_to_rst.py b/docs/source/utils/dbc_to_rst.py
new file mode 100644
index 0000000..57fef96
--- /dev/null
+++ b/docs/source/utils/dbc_to_rst.py
@@ -0,0 +1,139 @@
+import cantools
+
+# Load the DBC file
+db = cantools.database.load_file("uart_com.dbc")
+
+# Messages you want to document
+target_msgs = ["ChargeControl1", "ChargeState1", "PT1000State", "FirmwareVersion", "GitHash", "InquiryPacket"]
+
+# Sender name mapping
+sender_name_map = {
+ "Default_SafetyController": "Safety Controller",
+ "Default_Linux": "Linux Processor"
+}
+
+# Senders to exclude from display
+excluded_senders = {"CCY_SafetyController"}
+
+# Extract a signal row as a list of strings
+def signal_row(signal):
+ def safe(value):
+ if value is None or str(value).strip() == "":
+ return ""
+ return str(value).strip()
+
+ if signal.byte_order == "little_endian" and signal.length > 8:
+ byte_order = "Little Endian"
+ elif signal.byte_order == "big_endian" and signal.length > 8:
+ byte_order = "Big Endian"
+ else:
+ byte_order = ""
+
+ return [
+ safe(signal.name),
+ safe(signal.start),
+ safe(signal.length),
+ byte_order,
+ "Yes" if signal.is_signed else "No",
+ safe(signal.scale),
+ safe(signal.offset),
+ safe(signal.unit),
+ signal.comment.strip() if signal.comment else "*No description available*"
+ ]
+
+def format_bit_matrix(msg):
+ bit_width = 20
+ byte_label_width = 3
+ bitfield = [None] * (msg.length * 8)
+
+ for signal in msg.signals:
+ if signal.byte_order == "little_endian":
+ bit_indices = list(range(signal.start, signal.start + signal.length))
+ else:
+ bit_indices = list(range(signal.start, signal.start - signal.length, -1))
+
+ for idx in bit_indices:
+ if 0 <= idx < len(bitfield):
+ bitfield[idx] = signal.name
+
+ total_bits = msg.length * 8
+ num_rows = total_bits // 8
+ lines = []
+
+ # Header with byte index
+ border = " +" + "+".join(["-" * bit_width] * 8) + "+"
+ header = " |" + "|".join([f"{7 - i:^{bit_width}}" for i in range(8)]) + "|"
+ lines.extend([border, header, border])
+
+ for row in range(num_rows):
+ base = row * 8
+ seen = set()
+ row_cells = []
+ for i in range(8):
+ bit_index = base + (7 - i)
+ label = bitfield[bit_index]
+ if label and label not in seen:
+ cell = label[:bit_width].center(bit_width)
+ seen.add(label)
+ else:
+ cell = " " * bit_width
+ row_cells.append(cell)
+ lines.append(f"{row:>3}|" + "|".join(row_cells) + "|")
+ lines.append(border)
+
+ rst = "\n**Bitfield Layout**\n\n::\n\n"
+ rst += "\n".join(lines) + "\n"
+ return rst
+
+
+# Format one message block as RST
+def format_message_rst(msg):
+ rst = f"{msg.name}\n{'=' * len(msg.name)}\n\n"
+ rst += f"**ID**: 0x{msg.frame_id:X} ({msg.frame_id})\n\n"
+ rst += f"**Length**: {msg.length} bytes\n\n"
+ rst += f"**Description**: {msg.comment.strip() if msg.comment else 'N/A'}\n\n"
+
+ # Map and filter senders
+ senders = [sender_name_map.get(s, s) for s in msg.senders if s not in excluded_senders]
+ rst += f"**Senders**: {', '.join(senders) if senders else 'N/A'}\n\n"
+
+ # Table header
+ rst += f".. list-table:: Signals in {msg.name}\n"
+ rst += " :widths: 30 6 6 10 7 7 7 6 30\n"
+ rst += " :header-rows: 1\n\n"
+
+ headers = ["Name", "Start", "Length", "ByteOrder", "Signed", "Factor", "Offset", "Unit", "Description"]
+ rst += " * - " + "\n - ".join(headers) + "\n"
+
+ # Sort signals by start bit
+ sorted_signals = sorted(msg.signals, key=lambda s: s.start)
+ for sig in sorted_signals:
+ row = signal_row(sig)
+ rst += " * - " + "\n - ".join(row) + "\n"
+
+ # Value descriptions (choices)
+ choice_blocks = []
+ for sig in sorted_signals:
+ if sig.choices:
+ lines = [f" - 0x{int(k):X} = {v}" for k, v in sorted(sig.choices.items(), key=lambda x: int(x[0]), reverse=False)]
+ choice_blocks.append(f"- **{sig.name}**\n\n" + "\n".join(lines))
+
+ if choice_blocks:
+ rst += "\n**Value Descriptions**\n\n" + "\n\n".join(choice_blocks) + "\n"
+
+ rst += format_bit_matrix(msg)
+
+ return rst
+
+# Generate RST output
+output = ""
+for target_name in target_msgs:
+ msg = db.get_message_by_name(target_name)
+ if msg:
+ output += format_message_rst(msg) + "\n"
+ else:
+ print(f"Warning: Message '{target_name}' not found in DBC!")
+
+# Write to file
+with open("../safety_protocol.rst", "w", encoding="utf-8") as f:
+ f.write(output)
diff --git a/docs/source/utils/uart_com.dbc b/docs/source/utils/uart_com.dbc
new file mode 100644
index 0000000..6769525
--- /dev/null
+++ b/docs/source/utils/uart_com.dbc
@@ -0,0 +1,251 @@
+VERSION "0.0.1"
+
+
+NS_ :
+ NS_DESC_
+ CM_
+ BA_DEF_
+ BA_
+ VAL_
+ CAT_DEF_
+ CAT_
+ FILTER
+ BA_DEF_DEF_
+ EV_DATA_
+ ENVVAR_DATA_
+ SGTYPE_
+ SGTYPE_VAL_
+ BA_DEF_SGTYPE_
+ BA_SGTYPE_
+ SIG_TYPE_REF_
+ VAL_TABLE_
+ SIG_GROUP_
+ SIG_VALTYPE_
+ SIGTYPE_VALTYPE_
+ BO_TX_BU_
+ BA_DEF_REL_
+ BA_REL_
+ BA_DEF_DEF_REL_
+ BU_SG_REL_
+ BU_EV_REL_
+ BU_BO_REL_
+ SG_MUL_VAL_
+
+BS_:
+
+BU_: Default_HostController Default_SafetyController CCY_HostController CCY_SafetyController
+
+
+BO_ 255 InquiryPacket: 8 Default_HostController
+ SG_ PacketId : 7|8@0+ (1,0) [0|0] "" CCY_SafetyController,Default_SafetyController
+
+BO_ 0 DigitalOutput: 4 Default_HostController
+ SG_ DO_SAFETY_HVSW3_PRECHARGE : 9|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_CP_INVERT : 3|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_CP_Dutycycle : 31|8@0+ (1,0) [0|0] "%" Default_SafetyController
+ SG_ DO_PP_SAE_IEC : 15|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_CP_STATE_C : 18|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_GPIO_EXP : 12|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_IMD_OD_EN : 11|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_MOTOR_OUT2 : 5|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_MOTOR_OUT1 : 6|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_HVSW2_HS : 13|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_SAFETY_HVSW1_HS : 14|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_PT1000_CTRLEN4 : 10|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_PT1000_CTRLEN3 : 19|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_PT1000_CTRLEN2 : 20|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ DO_PT1000_CTRLEN1 : 21|1@0+ (1,0) [0|0] "" Default_SafetyController
+
+BO_ 18 DiagnosticMeasurements2: 8 CCY_SafetyController
+ SG_ DM_ID_ADC_VAL : 23|16@0+ (1,0) [0|0] "" CCY_HostController
+ SG_ DM_CE_ADC_VAL : 7|16@0+ (1,0) [0|0] "" CCY_HostController
+
+BO_ 5 AnalogInput04: 8 Default_SafetyController
+ SG_ AI_INT_REFVOLT : 39|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_INT_TEMP : 23|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_PT1000_CFB3_4 : 7|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+
+BO_ 4 AnalogInput03: 8 Default_SafetyController
+ SG_ AI_SAFETY_HS2_CFB : 39|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_SAFETY_HS1_CFB : 23|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_SAFETY_PRECHARGE_CFB : 7|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_PT1000_CFB1_2 : 55|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+
+BO_ 3 AnalogInput02: 8 Default_SafetyController
+ SG_ AI_SAFETY_U_IN_ADC : 55|16@0+ (1,0) [0|0] "" Default_HostController
+ SG_ AI_PP_VALUE_ADC : 39|16@0+ (1,0) [0|0] "" Default_HostController
+ SG_ AI_CP_BUFFERED_POS_ADC : 23|16@0+ (1,0) [0|0] "" Default_HostController
+ SG_ AI_CP_BUFFERED_NEG_ADC : 7|16@0+ (1,0) [0|0] "" Default_HostController
+
+BO_ 2 AnalogInput01: 8 Default_SafetyController
+ SG_ AI_PT1000_LEAD1_4 : 55|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_PT1000_LEAD1_3 : 39|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_PT1000_LEAD1_2 : 23|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+ SG_ AI_PT1000_LEAD1_1 : 7|16@0+ (1,0) [0|0] "" CCY_HostController,Default_HostController
+
+BO_ 17 ChargeControl2: 8 CCY_HostController
+ SG_ CC_ControllerReset : 3|2@0+ (1,0) [0|0] "" CCY_SafetyController
+ SG_ CC_CCSReady : 7|4@0+ (1,0) [0|0] "" CCY_SafetyController
+
+BO_ 16 ChargeState2: 8 CCY_SafetyController
+ SG_ CS_EStop_Reason : 15|8@0+ (1,0) [0|0] "" CCY_HostController
+ SG_ CS_ID_State : 3|4@0+ (1,0) [0|0] "" CCY_HostController
+ SG_ CS_CE_State : 7|4@0+ (1,0) [0|0] "" CCY_HostController
+
+BO_ 7 ChargeState1: 8 Default_SafetyController
+ SG_ CS_Estop1ChargingAbort : 41|2@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_Estop2ChargingAbort : 43|2@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_Estop3ChargingAbort : 45|2@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_Contactor1State : 33|2@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_Contactor2State : 36|2@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_Contactor1Error : 34|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_Contactor2Error : 37|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_HV_Ready : 38|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_CurrentPpState : 26|3@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_CurrentCpState : 18|3@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_CpShortCircuit : 19|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_DiodeFault : 20|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ CS_CurrentDutyCycle : 1|10@0+ (0.1,0) [0|0] "%" Default_HostController
+ SG_ CS_PWM_Active : 7|1@0+ (1,0) [0|0] "" Default_HostController
+
+BO_ 6 ChargeControl1: 8 Default_HostController
+ SG_ CC_Contactor1State : 16|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ CC_Contactor2State : 17|1@0+ (1,0) [0|0] "" Default_SafetyController
+ SG_ CC_TargetDutyCycle : 1|10@0+ (0.1,0) [0|0] "%" Default_SafetyController
+ SG_ CC_PWM_Active : 7|1@0+ (1,0) [0|0] "" Default_SafetyController
+
+BO_ 10 FirmwareVersion: 8 Default_SafetyController
+ SG_ MajorVersion : 7|8@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ MinorVersion : 15|8@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ BuildVersion : 23|8@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PlatformType : 31|8@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ ApplicationType : 39|8@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+
+BO_ 11 GitHash: 8 Default_SafetyController
+ SG_ HashSignal : 7|64@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+
+BO_ 14 ErrorMessage: 8 Default_SafetyController
+ SG_ ErrorAddData2 : 55|16@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ ErrorAddData1 : 39|16@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ ErrorModule : 6|15@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ ErrorReason : 23|16@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ ErrorActive : 7|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+
+BO_ 9 DiagnosticMeasurements: 8 Default_SafetyController
+ SG_ DM_PP_Voltage : 39|16@0- (1,0) [0|0] "" Default_SafetyController,Default_HostController
+ SG_ DM_CP_VoltagePositiveSide : 23|16@0- (1,0) [0|0] "" Default_SafetyController,Default_HostController
+ SG_ DM_CP_VoltageNegativeSide : 7|16@0- (1,0) [0|0] "" Default_SafetyController,Default_HostController
+
+BO_ 8 PT1000State: 8 Default_SafetyController
+ SG_ PT4_Temperature : 55|14@0- (0.1,0) [0|0] "°C" Default_HostController,CCY_HostController
+ SG_ PT4_SelftestFailed : 57|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT4_ChargingStopped : 56|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT3_Temperature : 39|14@0- (0.1,0) [0|0] "°C" Default_HostController,CCY_HostController
+ SG_ PT3_SelftestFailed : 41|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT3_ChargingStopped : 40|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT2_Temperature : 23|14@0- (0.1,0) [0|0] "°C" Default_HostController,CCY_HostController
+ SG_ PT2_SelftestFailed : 25|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT2_ChargingStopped : 24|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT1_Temperature : 7|14@0- (0.1,0) [0|0] "°C" Default_HostController,CCY_HostController
+ SG_ PT1_SelftestFailed : 9|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ PT1_ChargingStopped : 8|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+
+BO_ 1 DigitalInput: 3 CCY_SafetyController
+ SG_ DI_SAFETY_CP_STATE_C : 19|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_MOTOR_OUT1 : 6|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_MOTOR_OUT2 : 5|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_MOTOR_FAULT : 4|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_HVSW2_HS : 13|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_HVSW1_HS : 14|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_HVSW3_PRECHARGE : 9|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_PP_SAE_IEC : 15|1@0+ (1,0) [0|0] "" Default_HostController
+ SG_ DI_SAFETY_DEV_1 : 0|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_SAFETY_DEV_2 : 1|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_EV_CP_EDGE : 2|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_CP_INVERT : 3|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_SAFETY_K1_IN : 7|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_PT4_EN : 10|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_PT3_EN : 20|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_PT2_EN : 21|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_PT1_EN : 22|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_SAFETY_IMD_OD_EN : 11|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_SAFETY_GPIO_EXP : 12|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_ESTOP3 : 16|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_ESTOP2 : 17|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_ESTOP1 : 18|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+ SG_ DI_SAFETY_K2_IN : 8|1@0+ (1,0) [0|0] "" Default_HostController,CCY_HostController
+
+BO_TX_BU_ 255 : CCY_HostController,Default_HostController;
+BO_TX_BU_ 5 : CCY_SafetyController,Default_SafetyController;
+BO_TX_BU_ 4 : CCY_SafetyController,Default_SafetyController;
+BO_TX_BU_ 2 : CCY_SafetyController,Default_SafetyController;
+BO_TX_BU_ 10 : CCY_SafetyController,Default_SafetyController;
+BO_TX_BU_ 14 : CCY_SafetyController,Default_SafetyController;
+BO_TX_BU_ 8 : CCY_SafetyController,Default_SafetyController;
+BO_TX_BU_ 1 : Default_SafetyController,CCY_SafetyController;
+
+
+CM_ BO_ 255 "This packet is used to request a special message from the safety controller";
+CM_ SG_ 255 PacketId "The ID, which message shall be requested. Supported values are described below.";
+CM_ BO_ 7 "This message shall be sent from safety controller to host processor for indicating the state of the charging session as well as the state of connected peripherals.";
+CM_ SG_ 7 CS_Contactor1State "Is set when the contactor is closed";
+CM_ SG_ 7 CS_Contactor2State "Is set when the contactor is closed";
+CM_ SG_ 7 CS_Contactor1Error "Is set when an error in the contactor is detected";
+CM_ SG_ 7 CS_Contactor2Error "Is set when an error in the contactor is detected";
+CM_ SG_ 7 CS_HV_Ready "This is the state of the HV ready or State C output. This output is high, if the chargeSOM dont see any errors and CP is at state C. Otherwise it is low.";
+CM_ SG_ 7 CS_CurrentPpState "State of the proximity pin. For fixed cables at CCS2, this value is 0x0: No Cable detected";
+CM_ SG_ 7 CS_CurrentCpState "Current state of the control pilot. See value mappings below";
+CM_ SG_ 7 CS_CpShortCircuit " Is set when the safety controller detects a short-circuit condition between CP and PE line.";
+CM_ SG_ 7 CS_DiodeFault " Is set when the safety controller detects that the diode on EV side is missing.";
+CM_ SG_ 7 CS_CurrentDutyCycle "The current duty cycle between 0.0% and 100.0%. If the PWM is not aczive this signal is 0";
+CM_ SG_ 7 CS_PWM_Active "Feedback if PWM is active. 0 means not active, 1 means active";
+CM_ BO_ 6 "This message shall be sent from the host processor to the safety controller to control the peripherals connected to the safety controller.";
+CM_ SG_ 6 CC_Contactor1State "Request to close the contactor state. A value of 0 means open contactor, a value of 1 means closed contactor. The contactors are only closed if the system has no errors and is in state C.";
+CM_ SG_ 6 CC_Contactor2State "Request to close the contactor state. A value of 0 means open contactor, a value of 1 means closed contactor. The contactors are only closed if the system has no errors and is in state C.";
+CM_ SG_ 6 CC_TargetDutyCycle "Duty cycle between 0.0 and 100.0%. Values above 100.0% are set as 100%. Only valid if the signal CC_PWM_Active is 1";
+CM_ SG_ 6 CC_PWM_Active "This flag indicates if the PWM should be activated. At a value of 0, the CP level is also 0V. At a value of 1, the CP level is dependant of the duty cycle";
+CM_ BO_ 10 "This message provides information about the type and version of the flashed firmware";
+CM_ SG_ 10 MajorVersion "Major version of the firmware";
+CM_ SG_ 10 MinorVersion "Minor version of the firmware";
+CM_ SG_ 10 BuildVersion "Build or patch version of the firmware";
+CM_ SG_ 10 PlatformType "This firmware can be used for several products with minor changes in the build process. The platform type describes the used platform";
+CM_ SG_ 10 ApplicationType "The type of firmware. See possible values below";
+CM_ BO_ 11 "This message provides information about the GIT hash, written in the firmware";
+CM_ SG_ 11 HashSignal "First 8 byte of the 160 bit (SHA-1) GIT hash";
+CM_ BO_ 8 "This message shall be sent from safety controller to host processor for indicating the state of the connected temperature sensors";
+CM_ SG_ 8 PT4_Temperature "Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.";
+CM_ SG_ 8 PT4_SelftestFailed "Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT4_ChargingStopped "Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT3_Temperature "Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.";
+CM_ SG_ 8 PT3_SelftestFailed "Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT3_ChargingStopped "Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT2_Temperature "Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.";
+CM_ SG_ 8 PT2_SelftestFailed "Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT2_ChargingStopped "Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT1_Temperature "Current temperature of PT1000 channel in °C with one decimal digit. 0x1FFF stands for: temp sensor not used.";
+CM_ SG_ 8 PT1_SelftestFailed "Indicates whether this PT1000 channel is disturbed, multiple channel can signal the condition in parallel.";
+CM_ SG_ 8 PT1_ChargingStopped "Indicates whether this PT1000 channel prevents charging, multiple channel can signal the condition in parallel.";
+BA_DEF_ "MultiplexExtEnabled" ENUM "No","Yes";
+BA_DEF_ "BusType" STRING ;
+BA_DEF_DEF_ "MultiplexExtEnabled" "No";
+BA_DEF_DEF_ "BusType" "";
+BA_ "BusType" "J1708";
+VAL_ 255 PacketId 10 "FirmwareVersion" 11 "GitHash" ;
+VAL_ 17 CC_CCSReady 2 "CCS_EmergencyStop" 1 "CCS_Ready" 0 "CCS_NotReady" ;
+VAL_ 16 CS_EStop_Reason 13 "HVReady_Malfunction" 12 "CE_Malfunction" 11 "ID_Malfunction" 10 "Temp4_Overtemp" 9 "Temp3_Overtemp" 8 "Temp2_Overtemp" 7 "Temp1_Overtemp" 6 "Temp4_Malfunction" 5 "Temp3_Malfunction" 4 "Temp2_Malfunction" 3 "Temp1_Malfunction" 2 "ComTimeout" 1 "EmergencyInput" 0 "NoStop" ;
+VAL_ 16 CS_ID_State 15 "SNA" 14 "Invalid" 1 "Connected" 0 "Not_Connected" ;
+VAL_ 16 CS_CE_State 15 "SNA" 7 "Invalid" 6 "B0" 5 "EC" 4 "E" 3 "D" 2 "C" 1 "B" 0 "A" ;
+VAL_ 7 CS_Estop1ChargingAbort 0 "FALSE" 1 "TRUE" 3 "NotConfigured" ;
+VAL_ 7 CS_Estop2ChargingAbort 0 "FALSE" 1 "TRUE" 3 "NotConfigured" ;
+VAL_ 7 CS_Estop3ChargingAbort 0 "FALSE" 1 "TRUE" 3 "NotConfigured" ;
+VAL_ 7 CS_Contactor1State 0 "OPEN" 1 "CLOSE" 3 "NotConfigured" ;
+VAL_ 7 CS_Contactor2State 0 "OPEN" 1 "CLOSE" 3 "NotConfigured" ;
+VAL_ 7 CS_CurrentPpState 7 "Error" 6 "Type1_ConnectedButtonPressed" 5 "Type1_Connected" 4 "63/70A" 3 "32A" 2 "20A" 1 "13A" 0 "NoCableDetected" ;
+VAL_ 7 CS_CurrentCpState 0 "Unknown" 7 "Invalid" 6 "F" 5 "E" 4 "D" 3 "C" 2 "B" 1 "A" ;
+VAL_ 10 PlatformType 129 "chargeSOM" 130 "CCY" ;
+VAL_ 10 ApplicationType 3 "Firmware" 4 "End Of Line" 5 "Qualification" ;
+VAL_ 8 PT4_Temperature 8191 "TempSensorNotUsed" ;
+VAL_ 8 PT3_Temperature 8191 "TempSensorNotUsed" ;
+VAL_ 8 PT2_Temperature 8191 "TempSensorNotUsed" ;
+VAL_ 8 PT1_Temperature 8191 "TempSensorNotUsed" ;
+