1313#include "magic.h"
1414
1515
16+ /*
17+ * @brief Steering enable message (CAN frame) ID.
18+ *
19+ */
20+ #define OSCC_STEERING_ENABLE_CAN_ID (0x54)
21+
22+ /*
23+ * @brief Steering disable message (CAN frame) ID.
24+ *
25+ */
26+ #define OSCC_STEERING_DISABLE_CAN_ID (0x55)
27+
1628/*
1729 * @brief Steering command message (CAN frame) ID.
1830 *
4355 */
4456#define OSCC_STEERING_DTC_INVALID_SENSOR_VAL (0x0)
4557
58+ /*
59+ * @brief Steering DTC bitfield position indicating an operator override.
60+ *
61+ */
62+ #define OSCC_STEERING_DTC_OPERATOR_OVERRIDE (0x1)
63+
4664
4765#pragma pack(push)
4866#pragma pack(1)
4967
68+ /**
69+ * @brief Steering enable message.
70+ *
71+ * CAN frame ID: \ref OSCC_STEERING_ENABLE_CAN_ID
72+ *
73+ */
74+ typedef struct
75+ {
76+ uint8_t magic [2 ]; /*!< Magic number identifying CAN frame as from OSCC.
77+ * Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
78+ * Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
79+
80+ uint8_t reserved [6 ]; /*!< Reserved. */
81+ } oscc_steering_enable_s ;
82+
83+
84+ /**
85+ * @brief Steering disable message.
86+ *
87+ * CAN frame ID: \ref OSCC_STEERING_DISABLE_CAN_ID
88+ *
89+ */
90+ typedef struct
91+ {
92+ uint8_t magic [2 ]; /*!< Magic number identifying CAN frame as from OSCC.
93+ * Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
94+ * Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
95+
96+ uint8_t reserved [6 ]; /*!< Reserved. */
97+ } oscc_steering_disable_s ;
98+
99+
50100/**
51101 * @brief Steering command message data.
52102 *
55105 */
56106typedef struct
57107{
58- uint8_t magic [2 ]; /* Magic number identifying CAN frame as from OSCC.
59- Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
60- Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
108+ uint8_t magic [2 ]; /*!< Magic number identifying CAN frame as from OSCC.
109+ * Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
110+ * Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
61111
62112 uint16_t spoof_value_low ; /*!< Value to be sent on the low spoof signal. */
63113
64114 uint16_t spoof_value_high ; /*!< Value to be sent on the high spoof signal. */
65115
66- uint8_t enable ; /*!< Command to enable or disable steering control.
67- * Zero value means disable.
68- * Non-zero value means enable. */
69-
70- uint8_t reserved ; /*!< Reserved. */
116+ uint8_t reserved [2 ]; /*!< Reserved. */
71117} oscc_steering_command_s ;
72118
73119
@@ -79,9 +125,9 @@ typedef struct
79125 */
80126typedef struct
81127{
82- uint8_t magic [2 ]; /* Magic number identifying CAN frame as from OSCC.
83- Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
84- Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
128+ uint8_t magic [2 ]; /*!< Magic number identifying CAN frame as from OSCC.
129+ * Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
130+ * Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
85131
86132 uint8_t enabled ; /*!< Steering controls enabled state.
87133 * Zero value means disabled (commands are ignored).
@@ -92,7 +138,7 @@ typedef struct
92138 * Non-zero value means an operator has physically overridden
93139 * the system. */
94140
95- uint8_t dtcs ; /* Bitfield of DTCs present in the module. */
141+ uint8_t dtcs ; /*!< Bitfield of DTCs present in the module. */
96142
97143 uint8_t reserved [3 ]; /*!< Reserved. */
98144} oscc_steering_report_s ;
0 commit comments