SW0101基本OK
This commit is contained in:
parent
4df74475d2
commit
caf03c7a4a
3
cva_asw_m0128/.vscode/settings.json
vendored
3
cva_asw_m0128/.vscode/settings.json
vendored
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"hwctrl.h": "c"
|
"hwctrl.h": "c",
|
||||||
|
"can_message.h": "c"
|
||||||
},
|
},
|
||||||
"MicroPython.executeButton": [
|
"MicroPython.executeButton": [
|
||||||
{
|
{
|
||||||
|
@ -360,6 +360,12 @@
|
|||||||
<state>$PROJ_DIR$\src\TLE9461</state>
|
<state>$PROJ_DIR$\src\TLE9461</state>
|
||||||
<state>$PROJ_DIR$\src</state>
|
<state>$PROJ_DIR$\src</state>
|
||||||
<state>$PROJ_DIR$\src\RTT</state>
|
<state>$PROJ_DIR$\src\RTT</state>
|
||||||
|
<state>$PROJ_DIR$\src\CANmatrix\butl</state>
|
||||||
|
<state>$PROJ_DIR$\src\CANmatrix\conf</state>
|
||||||
|
<state>$PROJ_DIR$\src\CANmatrix\inc</state>
|
||||||
|
<state>$PROJ_DIR$\src\CANmatrix\lib</state>
|
||||||
|
<state>$PROJ_DIR$\src\hod</state>
|
||||||
|
<state>$PROJ_DIR$\src\hod\libtouch</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCStdIncCheck</name>
|
<name>CCStdIncCheck</name>
|
||||||
@ -691,7 +697,7 @@
|
|||||||
<data>
|
<data>
|
||||||
<extensions></extensions>
|
<extensions></extensions>
|
||||||
<cmdline></cmdline>
|
<cmdline></cmdline>
|
||||||
<hasPrio>0</hasPrio>
|
<hasPrio>248</hasPrio>
|
||||||
<buildSequence>inputOutputBased</buildSequence>
|
<buildSequence>inputOutputBased</buildSequence>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
@ -1106,6 +1112,27 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
<group>
|
<group>
|
||||||
<name>src</name>
|
<name>src</name>
|
||||||
|
<group>
|
||||||
|
<name>CANmatrix</name>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\usr\canmatrix-fmon.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\lib\canmatrix-fmon.h</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\lib\canmatrix.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\lib\canmatrix.h</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\butl\mfs_canmatrix-binutil.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\butl\mfs_canmatrix-binutil.h</name>
|
||||||
|
</file>
|
||||||
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<name>drivers</name>
|
<name>drivers</name>
|
||||||
<group>
|
<group>
|
||||||
@ -1469,6 +1496,21 @@
|
|||||||
<name>$PROJ_DIR$\SDK\platform\devices\CVM012x\mcu.h</name>
|
<name>$PROJ_DIR$\SDK\platform\devices\CVM012x\mcu.h</name>
|
||||||
</file>
|
</file>
|
||||||
</group>
|
</group>
|
||||||
|
<group>
|
||||||
|
<name>hod</name>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\hod_touchonly_20ms.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\libtouch\libtouch.a</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\touch_config.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\touch_widget_config.c</name>
|
||||||
|
</file>
|
||||||
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<name>linker</name>
|
<name>linker</name>
|
||||||
<file>
|
<file>
|
||||||
@ -1765,6 +1807,9 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<name>user</name>
|
<name>user</name>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\ad_button1.c</name>
|
||||||
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\src\appTask.c</name>
|
<name>$PROJ_DIR$\src\appTask.c</name>
|
||||||
</file>
|
</file>
|
||||||
@ -1774,9 +1819,15 @@
|
|||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\src\extern.c</name>
|
<name>$PROJ_DIR$\src\extern.c</name>
|
||||||
</file>
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\heat_NTC.c</name>
|
||||||
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\src\hwctrl.c</name>
|
<name>$PROJ_DIR$\src\hwctrl.c</name>
|
||||||
</file>
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\key.c</name>
|
||||||
|
</file>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<file>
|
<file>
|
||||||
|
@ -1428,6 +1428,27 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
<group>
|
<group>
|
||||||
<name>src</name>
|
<name>src</name>
|
||||||
|
<group>
|
||||||
|
<name>CANmatrix</name>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\usr\canmatrix-fmon.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\lib\canmatrix-fmon.h</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\lib\canmatrix.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\lib\canmatrix.h</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\butl\mfs_canmatrix-binutil.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\CANmatrix\butl\mfs_canmatrix-binutil.h</name>
|
||||||
|
</file>
|
||||||
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<name>drivers</name>
|
<name>drivers</name>
|
||||||
<group>
|
<group>
|
||||||
@ -1791,6 +1812,21 @@
|
|||||||
<name>$PROJ_DIR$\SDK\platform\devices\CVM012x\mcu.h</name>
|
<name>$PROJ_DIR$\SDK\platform\devices\CVM012x\mcu.h</name>
|
||||||
</file>
|
</file>
|
||||||
</group>
|
</group>
|
||||||
|
<group>
|
||||||
|
<name>hod</name>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\hod_touchonly_20ms.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\libtouch\libtouch.a</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\touch_config.c</name>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\hod\touch_widget_config.c</name>
|
||||||
|
</file>
|
||||||
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<name>linker</name>
|
<name>linker</name>
|
||||||
<file>
|
<file>
|
||||||
@ -2087,6 +2123,9 @@
|
|||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<name>user</name>
|
<name>user</name>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\ad_button1.c</name>
|
||||||
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\src\appTask.c</name>
|
<name>$PROJ_DIR$\src\appTask.c</name>
|
||||||
</file>
|
</file>
|
||||||
@ -2096,9 +2135,15 @@
|
|||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\src\extern.c</name>
|
<name>$PROJ_DIR$\src\extern.c</name>
|
||||||
</file>
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\heat_NTC.c</name>
|
||||||
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\src\hwctrl.c</name>
|
<name>$PROJ_DIR$\src\hwctrl.c</name>
|
||||||
</file>
|
</file>
|
||||||
|
<file>
|
||||||
|
<name>$PROJ_DIR$\src\key.c</name>
|
||||||
|
</file>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<file>
|
<file>
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
<MemConfigValue>E:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0128.ddf</MemConfigValue>
|
<MemConfigValue>E:\Program Files\IAR Systems\Embedded Workbench 9.2\arm\config\debugger\CVAChip\CVM0128.ddf</MemConfigValue>
|
||||||
</PlDriver>
|
</PlDriver>
|
||||||
<JLinkDriver>
|
<JLinkDriver>
|
||||||
<LeaveTargetRunning>_ 0</LeaveTargetRunning>
|
|
||||||
<CStepIntDis>_ 0</CStepIntDis>
|
|
||||||
<jlinkResetStyle>12</jlinkResetStyle>
|
<jlinkResetStyle>12</jlinkResetStyle>
|
||||||
<jlinkResetStrategy>0</jlinkResetStrategy>
|
<jlinkResetStrategy>0</jlinkResetStrategy>
|
||||||
<TraceBufferSize>0x10000</TraceBufferSize>
|
<TraceBufferSize>0x10000</TraceBufferSize>
|
||||||
<TraceStallIfFIFOFull>0x0</TraceStallIfFIFOFull>
|
<TraceStallIfFIFOFull>0x0</TraceStallIfFIFOFull>
|
||||||
<TracePortSize>0x0</TracePortSize>
|
<TracePortSize>0x0</TracePortSize>
|
||||||
|
<LeaveTargetRunning>_ 0</LeaveTargetRunning>
|
||||||
|
<CStepIntDis>_ 0</CStepIntDis>
|
||||||
</JLinkDriver>
|
</JLinkDriver>
|
||||||
<ArmDriver>
|
<ArmDriver>
|
||||||
<EnableCache>0</EnableCache>
|
<EnableCache>0</EnableCache>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<mode>0</mode>
|
<mode>0</mode>
|
||||||
</DisassembleMode>
|
</DisassembleMode>
|
||||||
<Breakpoints2>
|
<Breakpoints2>
|
||||||
<Bp0>_ 1 "EMUL_CODE" "{$PROJ_DIR$\src\appTask.c}.109.21" 0 0 1 "" 0 "" 0</Bp0>
|
<Bp0>_ 1 "EMUL_CODE" "{$PROJ_DIR$\src\appTask.c}.110.1" 0 0 1 "" 0 "" 0</Bp0>
|
||||||
<Count>1</Count>
|
<Count>1</Count>
|
||||||
</Breakpoints2>
|
</Breakpoints2>
|
||||||
<Aliases>
|
<Aliases>
|
||||||
|
File diff suppressed because one or more lines are too long
28
cva_asw_m0128/src/CANmatrix/butl/mfs_canmatrix-binutil.c
Normal file
28
cva_asw_m0128/src/CANmatrix/butl/mfs_canmatrix-binutil.c
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#include "mfs_canmatrix-binutil.h"
|
||||||
|
|
||||||
|
// DBC file version
|
||||||
|
#if (VER_CANMATRIX_MAJ != (0U)) || (VER_CANMATRIX_MIN != (0U))
|
||||||
|
#error The MFS_CANMATRIX binutil source file has inconsistency with core dbc lib!
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DEF_MFS_CANMATRIX__
|
||||||
|
|
||||||
|
mfs_canmatrix_rx_t mfs_canmatrix_rx;
|
||||||
|
|
||||||
|
mfs_canmatrix_tx_t mfs_canmatrix_tx;
|
||||||
|
|
||||||
|
#endif // __DEF_MFS_CANMATRIX__
|
||||||
|
|
||||||
|
uint32_t mfs_canmatrix_Receive(mfs_canmatrix_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)
|
||||||
|
{
|
||||||
|
uint32_t recid = 0;
|
||||||
|
if (_id == 0x3F0U) {
|
||||||
|
recid = Unpack_BCM_HEAT_CANmatrix(&(_m->BCM_HEAT), _d, dlc_);
|
||||||
|
}
|
||||||
|
|
||||||
|
return recid;
|
||||||
|
}
|
||||||
|
|
37
cva_asw_m0128/src/CANmatrix/butl/mfs_canmatrix-binutil.h
Normal file
37
cva_asw_m0128/src/CANmatrix/butl/mfs_canmatrix-binutil.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "dbccodeconf.h"
|
||||||
|
|
||||||
|
#include "canmatrix.h"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BCM_HEAT_t BCM_HEAT;
|
||||||
|
} mfs_canmatrix_rx_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
MFS_HOD_t MFS_HOD;
|
||||||
|
MFS_KEY_t MFS_KEY;
|
||||||
|
} mfs_canmatrix_tx_t;
|
||||||
|
|
||||||
|
uint32_t mfs_canmatrix_Receive(mfs_canmatrix_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc);
|
||||||
|
|
||||||
|
#ifdef __DEF_MFS_CANMATRIX__
|
||||||
|
|
||||||
|
extern mfs_canmatrix_rx_t mfs_canmatrix_rx;
|
||||||
|
|
||||||
|
extern mfs_canmatrix_tx_t mfs_canmatrix_tx;
|
||||||
|
|
||||||
|
#endif // __DEF_MFS_CANMATRIX__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
131
cva_asw_m0128/src/CANmatrix/conf/canmatrix-config.h
Normal file
131
cva_asw_m0128/src/CANmatrix/conf/canmatrix-config.h
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* include common dbccode configurations */
|
||||||
|
#include "dbccodeconf.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
This define enables using CAN message structs with bit-fielded signals
|
||||||
|
layout.
|
||||||
|
|
||||||
|
Note(!): bit-feild was not tested properly. */
|
||||||
|
|
||||||
|
#define CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
This macro enables using CAN message descriptive struct packing functions
|
||||||
|
(by default signature of pack function intakes a few simple typed params
|
||||||
|
for loading data, len, etc). To compile you need to define the struct
|
||||||
|
__CoderDbcCanFrame_t__ which must have fields:
|
||||||
|
|
||||||
|
u32 MsgId (CAN Frame message ID)
|
||||||
|
u8 DLC (CAN Frame payload length field)
|
||||||
|
u8 Data[8] (CAN Frame payload data)
|
||||||
|
u8 IDE (CAN Frame Extended (1) / Standard (0) ID type)
|
||||||
|
|
||||||
|
This struct definition have to be placed (or be included) in dbccodeconf.h */
|
||||||
|
|
||||||
|
#define CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
All the signals which have values of factor != 1 or offset != 0
|
||||||
|
will be named in message struct with posfix '_ro'. Pack to payload
|
||||||
|
operations will be made on this signal value as well as unpack from payload.
|
||||||
|
|
||||||
|
USE_SIGFLOAT macro makes some difference:
|
||||||
|
|
||||||
|
1. All the '_ro' fields will have a pair field with '_phys' postfix.
|
||||||
|
If only offset != 0 is true then the type of '_phys' signal is the same
|
||||||
|
as '_ro' signal. In other case the type will be @sigfloat_t which
|
||||||
|
have to be defined in user dbccodeconf.h
|
||||||
|
|
||||||
|
2. In pack function '_ro' signal will be rewritten by '_phys' signal, which
|
||||||
|
requires from user to use ONLY '_phys' signal for packing frame
|
||||||
|
|
||||||
|
3. In unpack function '_phys' signal will be written by '_ro' signal.
|
||||||
|
User have to use '_phys' signal to read physical value. */
|
||||||
|
|
||||||
|
/* #define CANMATRIX_USE_SIGFLOAT */
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
Note(!) that the "canmonitorutil.h" must be accessed in include path:
|
||||||
|
|
||||||
|
This macro adds:
|
||||||
|
|
||||||
|
- monitor field @mon1 to message struct
|
||||||
|
|
||||||
|
- capture system tick in unpack function and save value to mon1 field
|
||||||
|
to provide to user better missing frame detection code. For this case
|
||||||
|
user must provide function declared in canmonitorutil.h - GetSysTick()
|
||||||
|
which may return 1ms uptime.
|
||||||
|
|
||||||
|
- calling function FMon_*** (from 'fmon' driver) inside unpack function
|
||||||
|
which is empty by default and have to be filled by user if
|
||||||
|
tests for DLC, rolling, checksum are necessary */
|
||||||
|
|
||||||
|
/* #define CANMATRIX_USE_DIAG_MONITORS */
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
When monitor using is enabled (CANMATRIX_USE_DIAG_MONITORS) and define below
|
||||||
|
uncommented, additional signal will be added to message struct. ***_expt:
|
||||||
|
expected rolling counter, to perform monitoring rolling counter sequence
|
||||||
|
automatically (result may be tested in dedicated Fmon_*** function) */
|
||||||
|
|
||||||
|
/* #define CANMATRIX_AUTO_ROLL */
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
When monitor using is enabled (CANMATRIX_USE_DIAG_MONITORS) and define below
|
||||||
|
uncommented, frame checksum signal may be handled automatically.
|
||||||
|
|
||||||
|
The signal which may be marked as checksum signal must have substring
|
||||||
|
with next format:
|
||||||
|
<Checksum:XOR8:3>
|
||||||
|
|
||||||
|
where:
|
||||||
|
|
||||||
|
- "Checksum": constant marker word
|
||||||
|
|
||||||
|
- "XOR8": type of method, this text will be passed to GetFrameHash
|
||||||
|
(canmonitorutil.h) function as is, the best use case is to define 'enum
|
||||||
|
DbcCanCrcMethods' in canmonitorutil.h file with all possible
|
||||||
|
checksum algorithms (e.g. XOR8, XOR4 etc)
|
||||||
|
|
||||||
|
- "3": optional value that will be passed to GetFrameHash as integer value
|
||||||
|
|
||||||
|
Function GetFrameHash have to be implemented by user
|
||||||
|
|
||||||
|
In pack function checksum signal will be calculated automatically
|
||||||
|
and loaded to payload
|
||||||
|
|
||||||
|
In unpack function checksum signal is checked with calculated.
|
||||||
|
(result may be tested in dedicated Fmon_*** function). */
|
||||||
|
|
||||||
|
/* #define CANMATRIX_AUTO_CSM */
|
||||||
|
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- *
|
||||||
|
FMon handling model can be build in two ways:
|
||||||
|
|
||||||
|
1 - Default. In this case when specific frame unpack is called the
|
||||||
|
specific FMon_{Frame name}_{driver name} functoin will be called.
|
||||||
|
User's code scope has to define each of these functions. Each function is
|
||||||
|
responsible for the error handling of one frame
|
||||||
|
|
||||||
|
2 - MONO. In this case there is only one function to perform any frame
|
||||||
|
monitoring. This function has to be implemented in the user's code scope.
|
||||||
|
This function is named as FMon_MONO_{driver name}. It takes frame id
|
||||||
|
which can be used for selection of the logic for a frame monitoring.
|
||||||
|
This mode costs a bit more in runtime but when you often edit you DBC and you
|
||||||
|
have more than one project it could be more maintanable (there is
|
||||||
|
no necessity to replace source code)
|
||||||
|
|
||||||
|
For using MONO way uncomment line below */
|
||||||
|
/* #define CANMATRIX_USE_MONO_FMON */
|
33
cva_asw_m0128/src/CANmatrix/conf/dbccodeconf.h
Normal file
33
cva_asw_m0128/src/CANmatrix/conf/dbccodeconf.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
// when USE_SIGFLOAT enabed the sigfloat_t must be defined
|
||||||
|
// typedef double sigfloat_t;
|
||||||
|
|
||||||
|
// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined
|
||||||
|
#include "can_message.h"
|
||||||
|
typedef CAN_DATATYPE __CoderDbcCanFrame_t__;
|
||||||
|
|
||||||
|
// if you need to allocate rx and tx messages structs put the allocation macro here
|
||||||
|
// #define __DEF_{your_driver_name}__
|
||||||
|
#define __DEF_MFS_CANMATRIX__
|
||||||
|
|
||||||
|
// defualt @__ext_sig__ help types definition
|
||||||
|
|
||||||
|
typedef uint32_t ubitext_t;
|
||||||
|
typedef int32_t bitext_t;
|
||||||
|
|
||||||
|
// To provide a way to make missing control correctly you
|
||||||
|
// have to define macro @GetSystemTick() which has to
|
||||||
|
// return kind of tick counter (e.g. 1 ms ticker)
|
||||||
|
|
||||||
|
// #define GetSystemTick() __get__tick__()
|
||||||
|
|
||||||
|
// To provide a way to calculate hash (crc) for CAN
|
||||||
|
// frame's data field you have to define macro @GetFrameHash
|
||||||
|
|
||||||
|
// #define GetFrameHash(a,b,c,d,e) __get_hash__(a,b,c,d,e)
|
||||||
|
|
152
cva_asw_m0128/src/CANmatrix/dbc/DMK-RP-77A.dbc
Normal file
152
cva_asw_m0128/src/CANmatrix/dbc/DMK-RP-77A.dbc
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
VERSION "FCB V1.0"
|
||||||
|
|
||||||
|
|
||||||
|
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_: MFS BCM
|
||||||
|
VAL_TABLE_ DM_ERR 1 "ERROR" 0 "NO_ERROR" ;
|
||||||
|
VAL_TABLE_ DM_KeyState 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
|
||||||
|
|
||||||
|
BO_ 1008 BCM_HEAT: 8 BCM
|
||||||
|
SG_ BCM_HEATCTL : 0|8@1+ (1,0) [0|0] "" MFS
|
||||||
|
|
||||||
|
BO_ 1009 MFS_HOD: 8 MFS
|
||||||
|
SG_ MFS_HOD_TEMP : 48|8@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_HOD_HEATING : 57|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_HOD_HANDING : 56|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_HOD_DIFF : 39|16@0+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_HOD_RAW : 7|16@0+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_HOD_baseline : 23|16@0+ (1,0) [0|0] "" BCM
|
||||||
|
|
||||||
|
BO_ 1024 MFS_KEY: 8 MFS
|
||||||
|
SG_ MFS_ENCODER : 48|2@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_RollDownCnt : 56|4@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_RollUpCnt : 60|4@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_SET : 12|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_RST : 11|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_DistIncrease : 14|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_DistReduce : 13|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_ADAS : 10|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_360 : 9|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_MENU : 8|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_OK : 41|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_VOICE : 43|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_RIGHT : 42|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_RETURN : 45|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_PHONE : 44|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
SG_ MFS_KEY_LEFT : 40|1@1+ (1,0) [0|0] "" BCM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BA_DEF_ EV_ "GenEnvIsGeneratedDsp" ENUM "No","Yes";
|
||||||
|
BA_DEF_ EV_ "GenEnvAutoGenCtrl" ENUM "No","Yes";
|
||||||
|
BA_DEF_ EV_ "GenEnvMsgOffset" INT 0 2147483647;
|
||||||
|
BA_DEF_ EV_ "GenEnvMsgName" STRING ;
|
||||||
|
BA_DEF_ EV_ "GenEnvIsGeneratedSnd" ENUM "No","Yes";
|
||||||
|
BA_DEF_ SG_ "GenSigStartValue" FLOAT 0 1215752192;
|
||||||
|
BA_DEF_ SG_ "GenSigTimeoutValue" FLOAT 0 1215752192;
|
||||||
|
BA_DEF_ SG_ "GenSigInactiveValue" FLOAT 0 1215752192;
|
||||||
|
BA_DEF_ SG_ "GenSigMinValue" INT 0 2147483647;
|
||||||
|
BA_DEF_ SG_ "GenSigMaxValue" INT 0 2147483647;
|
||||||
|
BA_DEF_ SG_ "GenSigSendType" ENUM "Cycle";
|
||||||
|
BA_DEF_ SG_ "GenSigEnvVarType" ENUM "int","float","undef";
|
||||||
|
BA_DEF_ BO_ "GenMsgDelayTime" INT 0 0;
|
||||||
|
BA_DEF_ BO_ "GenMsgNrOfRepetition" INT 0 0;
|
||||||
|
BA_DEF_ BO_ "GenMsgCycleTimeFast" INT 0 0;
|
||||||
|
BA_DEF_ BO_ "NmMessage" ENUM "No","Yes";
|
||||||
|
BA_DEF_ BO_ "GenMsgCycleTime" INT 0 65535;
|
||||||
|
BA_DEF_ BO_ "VFrameFormat" ENUM "StandardCAN","ExtendedCAN","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","reserved","StandardCAN_FD","ExtendedCAN_FD";
|
||||||
|
BA_DEF_ BO_ "GenMsgSendType" ENUM "Cycle";
|
||||||
|
BA_DEF_ BU_ "NmStationAddress" HEX 0 127;
|
||||||
|
BA_DEF_ BU_ "CANoeStartDelay" INT 0 0;
|
||||||
|
BA_DEF_ BU_ "CANoeDrift" INT 0 0;
|
||||||
|
BA_DEF_ BU_ "CANoeJitterMin" INT 0 0;
|
||||||
|
BA_DEF_ BU_ "CANoeJitterMax" INT 0 0;
|
||||||
|
BA_DEF_ BU_ "ECU" STRING ;
|
||||||
|
BA_DEF_ BU_ "NodeLayerModules" STRING ;
|
||||||
|
BA_DEF_ "BusType" STRING ;
|
||||||
|
BA_DEF_ "GenEnvVarPrefix" STRING ;
|
||||||
|
BA_DEF_ "GenEnvVarEndingSnd" STRING ;
|
||||||
|
BA_DEF_ "GenEnvVarEndingDsp" STRING ;
|
||||||
|
BA_DEF_ "DBName" STRING ;
|
||||||
|
BA_DEF_DEF_ "GenEnvIsGeneratedDsp" "No";
|
||||||
|
BA_DEF_DEF_ "GenEnvAutoGenCtrl" "No";
|
||||||
|
BA_DEF_DEF_ "GenEnvMsgOffset" 0;
|
||||||
|
BA_DEF_DEF_ "GenEnvMsgName" "";
|
||||||
|
BA_DEF_DEF_ "GenEnvIsGeneratedSnd" "No";
|
||||||
|
BA_DEF_DEF_ "GenSigStartValue" 0;
|
||||||
|
BA_DEF_DEF_ "GenSigTimeoutValue" 0;
|
||||||
|
BA_DEF_DEF_ "GenSigInactiveValue" 0;
|
||||||
|
BA_DEF_DEF_ "GenSigMinValue" 0;
|
||||||
|
BA_DEF_DEF_ "GenSigMaxValue" 0;
|
||||||
|
BA_DEF_DEF_ "GenSigSendType" "Cycle";
|
||||||
|
BA_DEF_DEF_ "GenSigEnvVarType" "undef";
|
||||||
|
BA_DEF_DEF_ "GenMsgDelayTime" 0;
|
||||||
|
BA_DEF_DEF_ "GenMsgNrOfRepetition" 0;
|
||||||
|
BA_DEF_DEF_ "GenMsgCycleTimeFast" 0;
|
||||||
|
BA_DEF_DEF_ "NmMessage" "No";
|
||||||
|
BA_DEF_DEF_ "GenMsgCycleTime" 0;
|
||||||
|
BA_DEF_DEF_ "VFrameFormat" "StandardCAN";
|
||||||
|
BA_DEF_DEF_ "GenMsgSendType" "Cycle";
|
||||||
|
BA_DEF_DEF_ "NmStationAddress" 0;
|
||||||
|
BA_DEF_DEF_ "CANoeStartDelay" 0;
|
||||||
|
BA_DEF_DEF_ "CANoeDrift" 0;
|
||||||
|
BA_DEF_DEF_ "CANoeJitterMin" 0;
|
||||||
|
BA_DEF_DEF_ "CANoeJitterMax" 0;
|
||||||
|
BA_DEF_DEF_ "ECU" "";
|
||||||
|
BA_DEF_DEF_ "NodeLayerModules" "";
|
||||||
|
BA_DEF_DEF_ "BusType" "CAN";
|
||||||
|
BA_DEF_DEF_ "GenEnvVarPrefix" "PE";
|
||||||
|
BA_DEF_DEF_ "GenEnvVarEndingSnd" "_Ps";
|
||||||
|
BA_DEF_DEF_ "GenEnvVarEndingDsp" "_Pd";
|
||||||
|
BA_DEF_DEF_ "DBName" "";
|
||||||
|
BA_ "DBName" "CanMatrix";
|
||||||
|
BA_ "NmStationAddress" BU_ BCM 1;
|
||||||
|
BA_ "GenMsgCycleTime" BO_ 1008 100;
|
||||||
|
BA_ "GenMsgCycleTime" BO_ 1009 10;
|
||||||
|
BA_ "GenMsgCycleTime" BO_ 1024 10;
|
||||||
|
VAL_ 1024 MFS_KEY_SET 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_RST 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_DistIncrease 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_DistReduce 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_ADAS 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_360 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_MENU 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_OK 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_VOICE 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_RIGHT 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_RETURN 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_PHONE 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
VAL_ 1024 MFS_KEY_LEFT 1 "PRESSED" 0 "NOT_PRESS" ;
|
||||||
|
|
165
cva_asw_m0128/src/CANmatrix/dbc/DMK-RP-77A.ini
Normal file
165
cva_asw_m0128/src/CANmatrix/dbc/DMK-RP-77A.ini
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
[View_Vehicles]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,150,
|
||||||
|
[View_Vehicle]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,125,
|
||||||
|
[View_VehicleNetworks]
|
||||||
|
HIDDEN=3,9,
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,
|
||||||
|
DEFINITIONS=27,28,29,30,31,
|
||||||
|
COLUMNWIDTHS=125,125,100,100,150,100,100,100,100,100,
|
||||||
|
[View_VehicleNetwork]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,
|
||||||
|
DEFINITIONS=20,21,22,23,24,25,26,
|
||||||
|
COLUMNWIDTHS=125,125,100,125,150,50,50,50,50,50,100,100,
|
||||||
|
[View_VehicleNetworkTxMessages]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||||
|
DEFINITIONS=13,14,15,16,17,18,19,
|
||||||
|
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,50,50,50,100,50,100,100,
|
||||||
|
[View_VehicleNetworkSignals]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_VehicleControlUnit]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,
|
||||||
|
DEFINITIONS=20,21,22,23,24,25,26,
|
||||||
|
COLUMNWIDTHS=125,125,100,125,150,50,50,50,50,50,100,100,
|
||||||
|
[View_VehicleGateways]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,125,100,
|
||||||
|
[View_VehicleGatewaySignals]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,125,125,125,125,125,125,
|
||||||
|
[View_Networks]
|
||||||
|
HIDDEN=2,8,
|
||||||
|
ORDER=0,1,2,3,4,5,6,
|
||||||
|
DEFINITIONS=27,28,29,30,31,
|
||||||
|
COLUMNWIDTHS=125,100,100,150,100,100,100,100,100,
|
||||||
|
[View_Network]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,
|
||||||
|
DEFINITIONS=20,21,22,23,24,25,26,
|
||||||
|
COLUMNWIDTHS=125,125,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_NetworkTxMessages]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||||
|
DEFINITIONS=13,14,15,16,17,18,19,
|
||||||
|
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,50,50,50,100,50,100,100,
|
||||||
|
[View_NetworkTxSignals]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,-1,50,50,50,50,50,100,100,
|
||||||
|
[View_NetworkNodeGroup]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,
|
||||||
|
DEFINITIONS=20,21,22,23,24,25,26,
|
||||||
|
COLUMNWIDTHS=125,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_Ecus]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,150,
|
||||||
|
[View_Ecu]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,
|
||||||
|
DEFINITIONS=20,21,22,23,24,25,26,
|
||||||
|
COLUMNWIDTHS=125,125,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_EnvVars]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||||
|
DEFINITIONS=1,2,3,4,5,
|
||||||
|
COLUMNWIDTHS=125,100,100,50,50,50,50,100,100,150,100,100,50,100,100,
|
||||||
|
[View_EnvVar]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||||
|
DEFINITIONS=1,2,3,4,5,
|
||||||
|
COLUMNWIDTHS=125,125,100,100,50,50,50,50,100,100,150,100,100,50,100,100,
|
||||||
|
[View_NodeGroups]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,150,
|
||||||
|
[View_NodeGroup]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,125,55,150,
|
||||||
|
[View_Nodes]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,
|
||||||
|
DEFINITIONS=20,21,22,23,24,25,26,
|
||||||
|
COLUMNWIDTHS=125,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_Node]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,-1,50,50,50,50,50,100,100,
|
||||||
|
[View_NodeTxMessages]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||||
|
DEFINITIONS=13,14,15,16,17,18,19,
|
||||||
|
COLUMNWIDTHS=125,125,55,100,50,100,100,150,50,50,50,100,50,100,100,
|
||||||
|
[View_NodeTxMsg]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,-1,50,50,50,50,50,100,100,
|
||||||
|
[View_NodeTxSignals]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,-1,50,50,50,50,50,100,100,
|
||||||
|
[View_NodeRxSignals]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,-1,50,50,50,50,50,100,100,
|
||||||
|
[View_NodeTxSigs]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_NodeRxSigs]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_Messages]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||||
|
DEFINITIONS=13,14,15,16,17,18,19,
|
||||||
|
COLUMNWIDTHS=125,55,100,50,100,100,100,150,50,50,50,100,50,100,100,
|
||||||
|
[View_Message]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=283,125,107,99,125,100,100,100,50,50,50,50,100,100,150,50,50,50,50,50,100,100,
|
||||||
|
[View_Signals]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
|
||||||
|
DEFINITIONS=6,7,8,9,10,11,12,
|
||||||
|
COLUMNWIDTHS=207,122,100,100,100,50,50,50,50,100,343,150,50,50,50,50,50,100,100,
|
||||||
|
[View_ValueTables]
|
||||||
|
HIDDEN=
|
||||||
|
ORDER=0,1,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,150,
|
||||||
|
[View_AttrDefs]
|
||||||
|
HIDDEN=6,
|
||||||
|
ORDER=0,1,2,3,4,5,
|
||||||
|
DEFINITIONS=
|
||||||
|
COLUMNWIDTHS=125,100,100,50,50,100,150,
|
12
cva_asw_m0128/src/CANmatrix/dbc/说明.txt
Normal file
12
cva_asw_m0128/src/CANmatrix/dbc/说明.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
参考https://github.site/astand/c-coderdbc
|
||||||
|
生成指令
|
||||||
|
./coderdbc -dbc DMK-RP-77A.dbc -out ./gen/ -drvname CANmatrix -nodeutils -rw -driverdir -gendate
|
||||||
|
|
||||||
|
打包
|
||||||
|
tar -czvf CANmatrix.tar.gz CANmatrix
|
||||||
|
或
|
||||||
|
zip -r CANmatrix.zip CANmatrix
|
||||||
|
|
||||||
|
github加速
|
||||||
|
|
||||||
|
git clone https://github.site/astand/c-coderdbc.git coderdbc
|
55
cva_asw_m0128/src/CANmatrix/inc/canmonitorutil.h
Normal file
55
cva_asw_m0128/src/CANmatrix/inc/canmonitorutil.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// declare here all availible checksum algorithms
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
// XOR8 = 0,
|
||||||
|
// XOR4 = 1,
|
||||||
|
// etc
|
||||||
|
|
||||||
|
// it is up to user to have or to skip final enum value - @CRC_ALG_COUNT
|
||||||
|
CRC_ALG_COUNT
|
||||||
|
} DbcCanCrcMethods;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
// @last_cycle keeps tick-value when last frame was received
|
||||||
|
uint32_t last_cycle;
|
||||||
|
|
||||||
|
// @timeout_cycle keeps maximum timeout for frame, user responsibility
|
||||||
|
// to init this field and use it in missing frame monitoring function
|
||||||
|
uint32_t timeout_cycle;
|
||||||
|
|
||||||
|
// @frame_cnt keeps count of all the received frames
|
||||||
|
uint32_t frame_cnt;
|
||||||
|
|
||||||
|
// setting up @roll_error bit indicates roll counting fail.
|
||||||
|
// Bit is not clearing automatically!
|
||||||
|
uint32_t roll_error : 1;
|
||||||
|
|
||||||
|
// setting up @checksum_error bit indicates checksum checking failure.
|
||||||
|
// Bit is not clearing automatically!
|
||||||
|
uint32_t csm_error : 1;
|
||||||
|
|
||||||
|
// setting up @cycle_error bit indicates that time was overrunned.
|
||||||
|
// Bit is not clearing automatically!
|
||||||
|
uint32_t cycle_error : 1;
|
||||||
|
|
||||||
|
// setting up @dlc_error bit indicates that the actual length of
|
||||||
|
// CAN frame is less then defined by CAN matrix!
|
||||||
|
uint32_t dlc_error : 1;
|
||||||
|
|
||||||
|
} FrameMonitor_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
50
cva_asw_m0128/src/CANmatrix/lib/canmatrix-fmon.h
Normal file
50
cva_asw_m0128/src/CANmatrix/lib/canmatrix-fmon.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// DBC file version
|
||||||
|
#define VER_CANMATRIX_MAJ_FMON (0U)
|
||||||
|
#define VER_CANMATRIX_MIN_FMON (0U)
|
||||||
|
|
||||||
|
#include "canmatrix-config.h"
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
#include "canmonitorutil.h"
|
||||||
|
/*
|
||||||
|
This file contains the prototypes of all the functions that will be called
|
||||||
|
from each Unpack_*name* function to detect DBC related errors
|
||||||
|
It is the user responsibility to defined these functions in the
|
||||||
|
separated .c file. If it won't be done the linkage error will happen
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_MONO_FMON
|
||||||
|
|
||||||
|
void _FMon_MONO_canmatrix(FrameMonitor_t* _mon, uint32_t msgid);
|
||||||
|
|
||||||
|
#define FMon_BCM_HEAT_canmatrix(x, y) _FMon_MONO_canmatrix((x), (y))
|
||||||
|
#define FMon_MFS_HOD_canmatrix(x, y) _FMon_MONO_canmatrix((x), (y))
|
||||||
|
#define FMon_MFS_KEY_canmatrix(x, y) _FMon_MONO_canmatrix((x), (y))
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void _FMon_BCM_HEAT_canmatrix(FrameMonitor_t* _mon, uint32_t msgid);
|
||||||
|
void _FMon_MFS_HOD_canmatrix(FrameMonitor_t* _mon, uint32_t msgid);
|
||||||
|
void _FMon_MFS_KEY_canmatrix(FrameMonitor_t* _mon, uint32_t msgid);
|
||||||
|
|
||||||
|
#define FMon_BCM_HEAT_canmatrix(x, y) _FMon_BCM_HEAT_canmatrix((x), (y))
|
||||||
|
#define FMon_MFS_HOD_canmatrix(x, y) _FMon_MFS_HOD_canmatrix((x), (y))
|
||||||
|
#define FMon_MFS_KEY_canmatrix(x, y) _FMon_MFS_KEY_canmatrix((x), (y))
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
224
cva_asw_m0128/src/CANmatrix/lib/canmatrix.c
Normal file
224
cva_asw_m0128/src/CANmatrix/lib/canmatrix.c
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#include "canmatrix.h"
|
||||||
|
|
||||||
|
|
||||||
|
// DBC file version
|
||||||
|
#if (VER_CANMATRIX_MAJ != (0U)) || (VER_CANMATRIX_MIN != (0U))
|
||||||
|
#error The CANMATRIX dbc source files have different versions
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
// Function prototypes to be called each time CAN frame is unpacked
|
||||||
|
// FMon function may detect RC, CRC or DLC violation
|
||||||
|
#include "canmatrix-fmon.h"
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
// This macro guard for the case when you need to enable
|
||||||
|
// using diag monitors but there is no necessity in proper
|
||||||
|
// SysTick provider. For providing one you need define macro
|
||||||
|
// before this line - in dbccodeconf.h
|
||||||
|
|
||||||
|
#ifndef GetSystemTick
|
||||||
|
#define GetSystemTick() (0u)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This macro guard is for the case when you want to build
|
||||||
|
// app with enabled optoin auto CSM, but don't yet have
|
||||||
|
// proper getframehash implementation
|
||||||
|
|
||||||
|
#ifndef GetFrameHash
|
||||||
|
#define GetFrameHash(a,b,c,d,e) (0u)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This function performs extension of sign for the signals
|
||||||
|
// whose bit width value is not aligned to one of power of 2 or less than 8.
|
||||||
|
// The types 'bitext_t' and 'ubitext_t' define the biggest bit width which
|
||||||
|
// can be correctly handled. You need to select type which can contain
|
||||||
|
// n+1 bits where n is the largest signed signal width. For example if
|
||||||
|
// the most wide signed signal has a width of 31 bits you need to set
|
||||||
|
// bitext_t as int32_t and ubitext_t as uint32_t
|
||||||
|
// Defined these typedefs in @dbccodeconf.h or locally in 'dbcdrvname'-config.h
|
||||||
|
static bitext_t __ext_sig__(ubitext_t val, uint8_t bits)
|
||||||
|
{
|
||||||
|
ubitext_t const m = (ubitext_t) (1u << (bits - 1u));
|
||||||
|
return ((val ^ m) - m);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t Unpack_BCM_HEAT_CANmatrix(BCM_HEAT_t* _m, const uint8_t* _d, uint8_t dlc_)
|
||||||
|
{
|
||||||
|
(void)dlc_;
|
||||||
|
_m->BCM_HEATCTL = (uint8_t) ( (_d[0] & (0xFFU)) );
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
_m->mon1.dlc_error = (dlc_ < BCM_HEAT_DLC);
|
||||||
|
_m->mon1.last_cycle = GetSystemTick();
|
||||||
|
_m->mon1.frame_cnt++;
|
||||||
|
|
||||||
|
FMon_BCM_HEAT_canmatrix(&_m->mon1, BCM_HEAT_CANID);
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
return BCM_HEAT_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Pack_BCM_HEAT_CANmatrix(BCM_HEAT_t* _m, __CoderDbcCanFrame_t__* cframe)
|
||||||
|
{
|
||||||
|
uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(BCM_HEAT_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE);
|
||||||
|
|
||||||
|
cframe->Data[0] |= (uint8_t) ( (_m->BCM_HEATCTL & (0xFFU)) );
|
||||||
|
|
||||||
|
cframe->MsgId = (uint32_t) BCM_HEAT_CANID;
|
||||||
|
cframe->DLC = (uint8_t) BCM_HEAT_DLC;
|
||||||
|
cframe->IDE = (uint8_t) BCM_HEAT_IDE;
|
||||||
|
return BCM_HEAT_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint32_t Pack_BCM_HEAT_CANmatrix(BCM_HEAT_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)
|
||||||
|
{
|
||||||
|
uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(BCM_HEAT_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE);
|
||||||
|
|
||||||
|
_d[0] |= (uint8_t) ( (_m->BCM_HEATCTL & (0xFFU)) );
|
||||||
|
|
||||||
|
*_len = (uint8_t) BCM_HEAT_DLC;
|
||||||
|
*_ide = (uint8_t) BCM_HEAT_IDE;
|
||||||
|
return BCM_HEAT_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Unpack_MFS_HOD_CANmatrix(MFS_HOD_t* _m, const uint8_t* _d, uint8_t dlc_)
|
||||||
|
{
|
||||||
|
(void)dlc_;
|
||||||
|
_m->MFS_HOD_RAW = (uint16_t) ( ((_d[0] & (0xFFU)) << 8U) | (_d[1] & (0xFFU)) );
|
||||||
|
_m->MFS_HOD_baseline = (uint16_t) ( ((_d[2] & (0xFFU)) << 8U) | (_d[3] & (0xFFU)) );
|
||||||
|
_m->MFS_HOD_DIFF = (uint16_t) ( ((_d[4] & (0xFFU)) << 8U) | (_d[5] & (0xFFU)) );
|
||||||
|
_m->MFS_HOD_TEMP = (uint8_t) ( (_d[6] & (0xFFU)) );
|
||||||
|
_m->MFS_HOD_HANDING = (uint8_t) ( (_d[7] & (0x01U)) );
|
||||||
|
_m->MFS_HOD_HEATING = (uint8_t) ( ((_d[7] >> 1U) & (0x01U)) );
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
_m->mon1.dlc_error = (dlc_ < MFS_HOD_DLC);
|
||||||
|
_m->mon1.last_cycle = GetSystemTick();
|
||||||
|
_m->mon1.frame_cnt++;
|
||||||
|
|
||||||
|
FMon_MFS_HOD_canmatrix(&_m->mon1, MFS_HOD_CANID);
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
return MFS_HOD_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Pack_MFS_HOD_CANmatrix(MFS_HOD_t* _m, __CoderDbcCanFrame_t__* cframe)
|
||||||
|
{
|
||||||
|
uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(MFS_HOD_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE);
|
||||||
|
|
||||||
|
cframe->Data[0] |= (uint8_t) ( ((_m->MFS_HOD_RAW >> 8U) & (0xFFU)) );
|
||||||
|
cframe->Data[1] |= (uint8_t) ( (_m->MFS_HOD_RAW & (0xFFU)) );
|
||||||
|
cframe->Data[2] |= (uint8_t) ( ((_m->MFS_HOD_baseline >> 8U) & (0xFFU)) );
|
||||||
|
cframe->Data[3] |= (uint8_t) ( (_m->MFS_HOD_baseline & (0xFFU)) );
|
||||||
|
cframe->Data[4] |= (uint8_t) ( ((_m->MFS_HOD_DIFF >> 8U) & (0xFFU)) );
|
||||||
|
cframe->Data[5] |= (uint8_t) ( (_m->MFS_HOD_DIFF & (0xFFU)) );
|
||||||
|
cframe->Data[6] |= (uint8_t) ( (_m->MFS_HOD_TEMP & (0xFFU)) );
|
||||||
|
cframe->Data[7] |= (uint8_t) ( (_m->MFS_HOD_HANDING & (0x01U)) | ((_m->MFS_HOD_HEATING & (0x01U)) << 1U) );
|
||||||
|
|
||||||
|
cframe->MsgId = (uint32_t) MFS_HOD_CANID;
|
||||||
|
cframe->DLC = (uint8_t) MFS_HOD_DLC;
|
||||||
|
cframe->IDE = (uint8_t) MFS_HOD_IDE;
|
||||||
|
return MFS_HOD_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint32_t Pack_MFS_HOD_CANmatrix(MFS_HOD_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)
|
||||||
|
{
|
||||||
|
uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(MFS_HOD_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE);
|
||||||
|
|
||||||
|
_d[0] |= (uint8_t) ( ((_m->MFS_HOD_RAW >> 8U) & (0xFFU)) );
|
||||||
|
_d[1] |= (uint8_t) ( (_m->MFS_HOD_RAW & (0xFFU)) );
|
||||||
|
_d[2] |= (uint8_t) ( ((_m->MFS_HOD_baseline >> 8U) & (0xFFU)) );
|
||||||
|
_d[3] |= (uint8_t) ( (_m->MFS_HOD_baseline & (0xFFU)) );
|
||||||
|
_d[4] |= (uint8_t) ( ((_m->MFS_HOD_DIFF >> 8U) & (0xFFU)) );
|
||||||
|
_d[5] |= (uint8_t) ( (_m->MFS_HOD_DIFF & (0xFFU)) );
|
||||||
|
_d[6] |= (uint8_t) ( (_m->MFS_HOD_TEMP & (0xFFU)) );
|
||||||
|
_d[7] |= (uint8_t) ( (_m->MFS_HOD_HANDING & (0x01U)) | ((_m->MFS_HOD_HEATING & (0x01U)) << 1U) );
|
||||||
|
|
||||||
|
*_len = (uint8_t) MFS_HOD_DLC;
|
||||||
|
*_ide = (uint8_t) MFS_HOD_IDE;
|
||||||
|
return MFS_HOD_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Unpack_MFS_KEY_CANmatrix(MFS_KEY_t* _m, const uint8_t* _d, uint8_t dlc_)
|
||||||
|
{
|
||||||
|
(void)dlc_;
|
||||||
|
_m->MFS_MENU = (uint8_t) ( (_d[1] & (0x01U)) );
|
||||||
|
_m->MFS_KEY_360 = (uint8_t) ( ((_d[1] >> 1U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_ADAS = (uint8_t) ( ((_d[1] >> 2U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_RST = (uint8_t) ( ((_d[1] >> 3U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_SET = (uint8_t) ( ((_d[1] >> 4U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_DistReduce = (uint8_t) ( ((_d[1] >> 5U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_DistIncrease = (uint8_t) ( ((_d[1] >> 6U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_LEFT = (uint8_t) ( (_d[5] & (0x01U)) );
|
||||||
|
_m->MFS_KEY_OK = (uint8_t) ( ((_d[5] >> 1U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_RIGHT = (uint8_t) ( ((_d[5] >> 2U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_VOICE = (uint8_t) ( ((_d[5] >> 3U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_PHONE = (uint8_t) ( ((_d[5] >> 4U) & (0x01U)) );
|
||||||
|
_m->MFS_KEY_RETURN = (uint8_t) ( ((_d[5] >> 5U) & (0x01U)) );
|
||||||
|
_m->MFS_ENCODER = (uint8_t) ( (_d[6] & (0x03U)) );
|
||||||
|
_m->MFS_KEY_RollDownCnt = (uint8_t) ( (_d[7] & (0x0FU)) );
|
||||||
|
_m->MFS_RollUpCnt = (uint8_t) ( ((_d[7] >> 4U) & (0x0FU)) );
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
_m->mon1.dlc_error = (dlc_ < MFS_KEY_DLC);
|
||||||
|
_m->mon1.last_cycle = GetSystemTick();
|
||||||
|
_m->mon1.frame_cnt++;
|
||||||
|
|
||||||
|
FMon_MFS_KEY_canmatrix(&_m->mon1, MFS_KEY_CANID);
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
return MFS_KEY_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Pack_MFS_KEY_CANmatrix(MFS_KEY_t* _m, __CoderDbcCanFrame_t__* cframe)
|
||||||
|
{
|
||||||
|
uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(MFS_KEY_DLC); cframe->Data[i++] = CANMATRIX_INITIAL_BYTE_VALUE);
|
||||||
|
|
||||||
|
cframe->Data[1] |= (uint8_t) ( (_m->MFS_MENU & (0x01U)) | ((_m->MFS_KEY_360 & (0x01U)) << 1U) | ((_m->MFS_KEY_ADAS & (0x01U)) << 2U) | ((_m->MFS_KEY_RST & (0x01U)) << 3U) | ((_m->MFS_KEY_SET & (0x01U)) << 4U) | ((_m->MFS_KEY_DistReduce & (0x01U)) << 5U) | ((_m->MFS_KEY_DistIncrease & (0x01U)) << 6U) );
|
||||||
|
cframe->Data[5] |= (uint8_t) ( (_m->MFS_KEY_LEFT & (0x01U)) | ((_m->MFS_KEY_OK & (0x01U)) << 1U) | ((_m->MFS_KEY_RIGHT & (0x01U)) << 2U) | ((_m->MFS_KEY_VOICE & (0x01U)) << 3U) | ((_m->MFS_KEY_PHONE & (0x01U)) << 4U) | ((_m->MFS_KEY_RETURN & (0x01U)) << 5U) );
|
||||||
|
cframe->Data[6] |= (uint8_t) ( (_m->MFS_ENCODER & (0x03U)) );
|
||||||
|
cframe->Data[7] |= (uint8_t) ( (_m->MFS_KEY_RollDownCnt & (0x0FU)) | ((_m->MFS_RollUpCnt & (0x0FU)) << 4U) );
|
||||||
|
|
||||||
|
cframe->MsgId = (uint32_t) MFS_KEY_CANID;
|
||||||
|
cframe->DLC = (uint8_t) MFS_KEY_DLC;
|
||||||
|
cframe->IDE = (uint8_t) MFS_KEY_IDE;
|
||||||
|
return MFS_KEY_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint32_t Pack_MFS_KEY_CANmatrix(MFS_KEY_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)
|
||||||
|
{
|
||||||
|
uint8_t i; for (i = 0u; i < CANMATRIX_VALIDATE_DLC(MFS_KEY_DLC); _d[i++] = CANMATRIX_INITIAL_BYTE_VALUE);
|
||||||
|
|
||||||
|
_d[1] |= (uint8_t) ( (_m->MFS_MENU & (0x01U)) | ((_m->MFS_KEY_360 & (0x01U)) << 1U) | ((_m->MFS_KEY_ADAS & (0x01U)) << 2U) | ((_m->MFS_KEY_RST & (0x01U)) << 3U) | ((_m->MFS_KEY_SET & (0x01U)) << 4U) | ((_m->MFS_KEY_DistReduce & (0x01U)) << 5U) | ((_m->MFS_KEY_DistIncrease & (0x01U)) << 6U) );
|
||||||
|
_d[5] |= (uint8_t) ( (_m->MFS_KEY_LEFT & (0x01U)) | ((_m->MFS_KEY_OK & (0x01U)) << 1U) | ((_m->MFS_KEY_RIGHT & (0x01U)) << 2U) | ((_m->MFS_KEY_VOICE & (0x01U)) << 3U) | ((_m->MFS_KEY_PHONE & (0x01U)) << 4U) | ((_m->MFS_KEY_RETURN & (0x01U)) << 5U) );
|
||||||
|
_d[6] |= (uint8_t) ( (_m->MFS_ENCODER & (0x03U)) );
|
||||||
|
_d[7] |= (uint8_t) ( (_m->MFS_KEY_RollDownCnt & (0x0FU)) | ((_m->MFS_RollUpCnt & (0x0FU)) << 4U) );
|
||||||
|
|
||||||
|
*_len = (uint8_t) MFS_KEY_DLC;
|
||||||
|
*_ide = (uint8_t) MFS_KEY_IDE;
|
||||||
|
return MFS_KEY_CANID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
424
cva_asw_m0128/src/CANmatrix/lib/canmatrix.h
Normal file
424
cva_asw_m0128/src/CANmatrix/lib/canmatrix.h
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
// DBC file version
|
||||||
|
#define VER_CANMATRIX_MAJ (0U)
|
||||||
|
#define VER_CANMATRIX_MIN (0U)
|
||||||
|
|
||||||
|
// include current dbc-driver compilation config
|
||||||
|
#include "canmatrix-config.h"
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
// This file must define:
|
||||||
|
// base monitor struct
|
||||||
|
#include "canmonitorutil.h"
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
|
||||||
|
// DLC maximum value which is used as the limit for frame's data buffer size.
|
||||||
|
// Client can set its own value (not sure why) in driver-config
|
||||||
|
// or can test it on some limit specified by application
|
||||||
|
// e.g.: static_assert(TESTDB_MAX_DLC_VALUE <= APPLICATION_FRAME_DATA_SIZE, "Max DLC value in the driver is too big")
|
||||||
|
#ifndef CANMATRIX_MAX_DLC_VALUE
|
||||||
|
// The value which was found out by generator (real max value)
|
||||||
|
#define CANMATRIX_MAX_DLC_VALUE 8U
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The limit is used for setting frame's data bytes
|
||||||
|
#define CANMATRIX_VALIDATE_DLC(msgDlc) (((msgDlc) <= (CANMATRIX_MAX_DLC_VALUE)) ? (msgDlc) : (CANMATRIX_MAX_DLC_VALUE))
|
||||||
|
|
||||||
|
// Initial byte value to be filles in data bytes of the frame before pack signals
|
||||||
|
// User can define its own custom value in driver-config file
|
||||||
|
#ifndef CANMATRIX_INITIAL_BYTE_VALUE
|
||||||
|
#define CANMATRIX_INITIAL_BYTE_VALUE 0U
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// def @BCM_HEAT CAN Message (1008 0x3f0)
|
||||||
|
#define BCM_HEAT_IDE (0U)
|
||||||
|
#define BCM_HEAT_DLC (8U)
|
||||||
|
#define BCM_HEAT_CANID (0x3f0U)
|
||||||
|
#define BCM_HEAT_CYC (100U)
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
#ifdef CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
uint8_t BCM_HEATCTL; // Bits= 8
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint8_t BCM_HEATCTL; // Bits= 8
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
FrameMonitor_t mon1;
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
} BCM_HEAT_t;
|
||||||
|
|
||||||
|
// def @MFS_HOD CAN Message (1009 0x3f1)
|
||||||
|
#define MFS_HOD_IDE (0U)
|
||||||
|
#define MFS_HOD_DLC (8U)
|
||||||
|
#define MFS_HOD_CANID (0x3f1U)
|
||||||
|
#define MFS_HOD_CYC (10U)
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
#ifdef CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
uint16_t MFS_HOD_RAW; // Bits=16
|
||||||
|
|
||||||
|
uint16_t MFS_HOD_baseline; // Bits=16
|
||||||
|
|
||||||
|
uint16_t MFS_HOD_DIFF; // Bits=16
|
||||||
|
|
||||||
|
uint8_t MFS_HOD_TEMP; // Bits= 8
|
||||||
|
|
||||||
|
uint8_t MFS_HOD_HANDING : 1; // Bits= 1
|
||||||
|
|
||||||
|
uint8_t MFS_HOD_HEATING : 1; // Bits= 1
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint16_t MFS_HOD_RAW; // Bits=16
|
||||||
|
|
||||||
|
uint16_t MFS_HOD_baseline; // Bits=16
|
||||||
|
|
||||||
|
uint16_t MFS_HOD_DIFF; // Bits=16
|
||||||
|
|
||||||
|
uint8_t MFS_HOD_TEMP; // Bits= 8
|
||||||
|
|
||||||
|
uint8_t MFS_HOD_HANDING; // Bits= 1
|
||||||
|
|
||||||
|
uint8_t MFS_HOD_HEATING; // Bits= 1
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
FrameMonitor_t mon1;
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
} MFS_HOD_t;
|
||||||
|
|
||||||
|
// def @MFS_KEY CAN Message (1024 0x400)
|
||||||
|
#define MFS_KEY_IDE (0U)
|
||||||
|
#define MFS_KEY_DLC (8U)
|
||||||
|
#define MFS_KEY_CANID (0x400U)
|
||||||
|
#define MFS_KEY_CYC (10U)
|
||||||
|
|
||||||
|
// Value tables for @MFS_MENU signal
|
||||||
|
|
||||||
|
#ifndef MFS_MENU_MFS_KEY_PRESSED
|
||||||
|
#define MFS_MENU_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_MENU_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_MENU_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_360 signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_360_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_360_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_360_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_360_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_ADAS signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_ADAS_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_ADAS_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_ADAS_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_ADAS_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_RST signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_RST_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_RST_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_RST_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_RST_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_SET signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_SET_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_SET_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_SET_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_SET_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_DistReduce signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_DistReduce_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_DistReduce_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_DistReduce_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_DistReduce_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_DistIncrease signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_DistIncrease_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_DistIncrease_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_DistIncrease_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_DistIncrease_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_LEFT signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_LEFT_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_LEFT_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_LEFT_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_LEFT_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_OK signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_OK_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_OK_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_OK_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_OK_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_RIGHT signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_RIGHT_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_RIGHT_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_RIGHT_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_RIGHT_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_VOICE signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_VOICE_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_VOICE_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_VOICE_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_VOICE_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_PHONE signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_PHONE_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_PHONE_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_PHONE_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_PHONE_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Value tables for @MFS_KEY_RETURN signal
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_RETURN_MFS_KEY_PRESSED
|
||||||
|
#define MFS_KEY_RETURN_MFS_KEY_PRESSED (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MFS_KEY_RETURN_MFS_KEY_NOT_PRESS
|
||||||
|
#define MFS_KEY_RETURN_MFS_KEY_NOT_PRESS (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
#ifdef CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_MENU : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_360 : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_ADAS : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_RST : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_SET : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_DistReduce : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_DistIncrease : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_LEFT : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_OK : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_RIGHT : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_VOICE : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_PHONE : 1; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_RETURN : 1; // Bits= 1
|
||||||
|
|
||||||
|
uint8_t MFS_ENCODER : 2; // Bits= 2
|
||||||
|
|
||||||
|
uint8_t MFS_KEY_RollDownCnt : 4; // Bits= 4
|
||||||
|
|
||||||
|
uint8_t MFS_RollUpCnt : 4; // Bits= 4
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_MENU; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_360; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_ADAS; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_RST; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_SET; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_DistReduce; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_DistIncrease; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_LEFT; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_OK; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_RIGHT; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_VOICE; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_PHONE; // Bits= 1
|
||||||
|
|
||||||
|
// 1 : "PRESSED"
|
||||||
|
// 0 : "NOT_PRESS"
|
||||||
|
uint8_t MFS_KEY_RETURN; // Bits= 1
|
||||||
|
|
||||||
|
uint8_t MFS_ENCODER; // Bits= 2
|
||||||
|
|
||||||
|
uint8_t MFS_KEY_RollDownCnt; // Bits= 4
|
||||||
|
|
||||||
|
uint8_t MFS_RollUpCnt; // Bits= 4
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_BITS_SIGNAL
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
FrameMonitor_t mon1;
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
} MFS_KEY_t;
|
||||||
|
|
||||||
|
// Function signatures
|
||||||
|
|
||||||
|
uint32_t Unpack_BCM_HEAT_CANmatrix(BCM_HEAT_t* _m, const uint8_t* _d, uint8_t dlc_);
|
||||||
|
#ifdef CANMATRIX_USE_CANSTRUCT
|
||||||
|
uint32_t Pack_BCM_HEAT_CANmatrix(BCM_HEAT_t* _m, __CoderDbcCanFrame_t__* cframe);
|
||||||
|
#else
|
||||||
|
uint32_t Pack_BCM_HEAT_CANmatrix(BCM_HEAT_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);
|
||||||
|
#endif // CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Unpack_MFS_HOD_CANmatrix(MFS_HOD_t* _m, const uint8_t* _d, uint8_t dlc_);
|
||||||
|
#ifdef CANMATRIX_USE_CANSTRUCT
|
||||||
|
uint32_t Pack_MFS_HOD_CANmatrix(MFS_HOD_t* _m, __CoderDbcCanFrame_t__* cframe);
|
||||||
|
#else
|
||||||
|
uint32_t Pack_MFS_HOD_CANmatrix(MFS_HOD_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);
|
||||||
|
#endif // CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
uint32_t Unpack_MFS_KEY_CANmatrix(MFS_KEY_t* _m, const uint8_t* _d, uint8_t dlc_);
|
||||||
|
#ifdef CANMATRIX_USE_CANSTRUCT
|
||||||
|
uint32_t Pack_MFS_KEY_CANmatrix(MFS_KEY_t* _m, __CoderDbcCanFrame_t__* cframe);
|
||||||
|
#else
|
||||||
|
uint32_t Pack_MFS_KEY_CANmatrix(MFS_KEY_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);
|
||||||
|
#endif // CANMATRIX_USE_CANSTRUCT
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
43
cva_asw_m0128/src/CANmatrix/usr/canmatrix-fmon.c
Normal file
43
cva_asw_m0128/src/CANmatrix/usr/canmatrix-fmon.c
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// Generator version : v3.1
|
||||||
|
// Generation time : 2024.12.27 15:27:04
|
||||||
|
// DBC filename : DMK-RP-77A.dbc
|
||||||
|
#include "canmatrix-fmon.h"
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_DIAG_MONITORS
|
||||||
|
|
||||||
|
/*
|
||||||
|
Put the monitor function content here, keep in mind -
|
||||||
|
next generation will completely clear all manually added code (!)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CANMATRIX_USE_MONO_FMON
|
||||||
|
|
||||||
|
void _FMon_MONO_canmatrix(FrameMonitor_t* _mon, uint32_t msgid)
|
||||||
|
{
|
||||||
|
(void)_mon;
|
||||||
|
(void)msgid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void _FMon_BCM_HEAT_canmatrix(FrameMonitor_t* _mon, uint32_t msgid)
|
||||||
|
{
|
||||||
|
(void)_mon;
|
||||||
|
(void)msgid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _FMon_MFS_HOD_canmatrix(FrameMonitor_t* _mon, uint32_t msgid)
|
||||||
|
{
|
||||||
|
(void)_mon;
|
||||||
|
(void)msgid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _FMon_MFS_KEY_canmatrix(FrameMonitor_t* _mon, uint32_t msgid)
|
||||||
|
{
|
||||||
|
(void)_mon;
|
||||||
|
(void)msgid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_MONO_FMON
|
||||||
|
|
||||||
|
#endif // CANMATRIX_USE_DIAG_MONITORS
|
@ -80,7 +80,7 @@ void adc_init(void)
|
|||||||
/* Enable ADC interrupts */
|
/* Enable ADC interrupts */
|
||||||
IrqDrv_EnableIrq(ADC_IRQn);
|
IrqDrv_EnableIrq(ADC_IRQn);
|
||||||
|
|
||||||
AdcDrv_Configure(&mcu.adcDrv, &adcCfg);
|
AdcDrv_Configure(&mcu.adcDrv, &adcCfg);
|
||||||
|
|
||||||
/* Configure PDB module */
|
/* Configure PDB module */
|
||||||
uint32_t pdbFreq;
|
uint32_t pdbFreq;
|
||||||
@ -97,7 +97,7 @@ void adc_init(void)
|
|||||||
pdbCfg.preTrgCfg.mode[0][1] = PDBDRV_PRETRG_BB_MODE;
|
pdbCfg.preTrgCfg.mode[0][1] = PDBDRV_PRETRG_BB_MODE;
|
||||||
pdbCfg.preTrgCfg.mode[0][2] = PDBDRV_PRETRG_BB_MODE; /* The others use Back-to-Back operation */
|
pdbCfg.preTrgCfg.mode[0][2] = PDBDRV_PRETRG_BB_MODE; /* The others use Back-to-Back operation */
|
||||||
pdbCfg.preTrgCfg.mode[0][3] = PDBDRV_PRETRG_BB_MODE;
|
pdbCfg.preTrgCfg.mode[0][3] = PDBDRV_PRETRG_BB_MODE;
|
||||||
pdbCfg.dlyCfg.modCnt = pdbFreq / 128 / 4000; /* Periodic triggering PDB in 1s*/
|
pdbCfg.dlyCfg.modCnt = pdbFreq / 128 / 40 / 100; /* Periodic triggering PDB in 1s*/
|
||||||
pdbCfg.dlyCfg.dlyCnt[0][0] = 0; /* first channel don't need delay time*/
|
pdbCfg.dlyCfg.dlyCnt[0][0] = 0; /* first channel don't need delay time*/
|
||||||
PdbDrv_Configure(&mcu.pdbDrv, &pdbCfg);
|
PdbDrv_Configure(&mcu.pdbDrv, &pdbCfg);
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include "uds_user.h"
|
#include "uds_user.h"
|
||||||
#include "TLE94x1.h"
|
#include "TLE94x1.h"
|
||||||
#include "SEGGER_RTT.h"
|
#include "SEGGER_RTT.h"
|
||||||
|
#include "hod.h"
|
||||||
|
#include "ad_button1.h"
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* the defines
|
* the defines
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
@ -87,6 +89,9 @@ uint32_t hod_heating_duty = 0; /* control heating duty, 10 ~ 99. */
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* the functions
|
* the functions
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
void heat_deal(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Asw_SetBootloaderRequest(void)
|
void Asw_SetBootloaderRequest(void)
|
||||||
{
|
{
|
||||||
@ -126,20 +131,21 @@ void appTask(void)
|
|||||||
gSystick1msEvent--;
|
gSystick1msEvent--;
|
||||||
gSystick1msCnt++;
|
gSystick1msCnt++;
|
||||||
gSysTick1sCnt++;
|
gSysTick1sCnt++;
|
||||||
CANMsgTask();
|
|
||||||
if (gSystick1msCnt % 5 == 0)
|
if (gSystick1msCnt % 5 == 0)
|
||||||
{
|
{
|
||||||
|
CAN_MsgUpdate();
|
||||||
}
|
}
|
||||||
if (gSystick1msCnt % 50 == 0)
|
if (gSystick1msCnt % 50 == 0)
|
||||||
{
|
{
|
||||||
SBC_WD_Trigger();//喂狗
|
SBC_WD_Trigger();//喂狗
|
||||||
|
|
||||||
}
|
}
|
||||||
if (gSystick1msCnt % 1000 == 0)
|
if (gSystick1msCnt % 1000 == 0)
|
||||||
{
|
{
|
||||||
//TxTestMsg(NULL);
|
//TxTestMsg(NULL);
|
||||||
uint8_t ret = SBC_Read_Command(SBC_M_S_CTRL);//sbc测试
|
uint8_t ret = SBC_Read_Command(SBC_M_S_CTRL);//sbc测试
|
||||||
SEGGER_RTT_printf(0,"%06d : M_S_CTRL = 0x%x\n",0,ret);
|
//SEGGER_RTT_printf(0,"%06d : M_S_CTRL = 0x%x\n",0,ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -148,6 +154,9 @@ void appTask(void)
|
|||||||
gSystick1msCnt = 0;
|
gSystick1msCnt = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//1ms task
|
||||||
|
CANMsgTask();
|
||||||
hod_task(timer_1ms);
|
hod_task(timer_1ms);
|
||||||
heat_deal();
|
heat_deal();
|
||||||
}
|
}
|
||||||
@ -155,19 +164,25 @@ void appTask(void)
|
|||||||
|
|
||||||
void hod_upload_info_cb(int16_t raw, int16_t base, int16_t diff)
|
void hod_upload_info_cb(int16_t raw, int16_t base, int16_t diff)
|
||||||
{
|
{
|
||||||
rawdata = raw;
|
//rawdata = raw;
|
||||||
basedata = base;
|
//basedata = base;
|
||||||
diffdata = diff;
|
//diffdata = diff;
|
||||||
|
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_RAW = raw;
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_baseline = base;
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_DIFF = diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hod_touch_on_cb()
|
void hod_touch_on_cb()
|
||||||
{
|
{
|
||||||
handing = 1;
|
handing = 1;
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_HANDING = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hod_touch_off_cb()
|
void hod_touch_off_cb()
|
||||||
{
|
{
|
||||||
handing = 0;
|
handing = 0;
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_HANDING = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void heat_deal(void)
|
void heat_deal(void)
|
||||||
|
@ -22,12 +22,10 @@ typedef enum
|
|||||||
UDS_MSG_IDX_STD_TX,
|
UDS_MSG_IDX_STD_TX,
|
||||||
|
|
||||||
|
|
||||||
UDS_MSG_IDX_STD_RX_TEST1,
|
UDS_MSG_IDX_STD_RX_BCM_HEAT,
|
||||||
UDS_MSG_IDX_STD_RX_TEST2,
|
UDS_MSG_IDX_STD_TX_MFS_HOD,
|
||||||
UDS_MSG_IDX_STD_TX_TEST1,
|
UDS_MSG_IDX_STD_TX_MFS_KEY,
|
||||||
|
UDS_MSG_IDX_STD_TX_TEST,
|
||||||
UDS_MSG_IDX_STD_TEST1,
|
|
||||||
UDS_MSG_IDX_STD_TEST2,
|
|
||||||
|
|
||||||
UDS_MSG_IDX_NUM
|
UDS_MSG_IDX_NUM
|
||||||
} Uds_MsgIdIdxType;
|
} Uds_MsgIdIdxType;
|
||||||
@ -51,6 +49,12 @@ FlexCanDrvType* flexCanDrv_DemoObj;
|
|||||||
uint8_t flexCanBoot_EnhanceRxFFCnt = 0;
|
uint8_t flexCanBoot_EnhanceRxFFCnt = 0;
|
||||||
uint8_t txMsgBuf[8] = {0};
|
uint8_t txMsgBuf[8] = {0};
|
||||||
|
|
||||||
|
CAN_MESSAGE CAN_D_mfs_key;
|
||||||
|
CAN_MESSAGE CAN_D_mfs_hod;
|
||||||
|
|
||||||
|
|
||||||
|
extern volatile uint16_t tempdata;
|
||||||
|
extern uint8_t heating;
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* the const
|
* the const
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
@ -59,11 +63,11 @@ const FlexCanDrv_MsgCfgType msgCfgObj[UDS_MSG_IDX_NUM] = {
|
|||||||
{UDS_MSG_IDX_STD_RX_PHYS, 1, UDS_PHYS_RECV_MSG_ID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_RX_PHYS */
|
{UDS_MSG_IDX_STD_RX_PHYS, 1, UDS_PHYS_RECV_MSG_ID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_RX_PHYS */
|
||||||
{UDS_MSG_IDX_STD_RX_FUNC, 1, UDS_FUNC_RECV_MSG_ID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_RX_FUNC */
|
{UDS_MSG_IDX_STD_RX_FUNC, 1, UDS_FUNC_RECV_MSG_ID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_RX_FUNC */
|
||||||
{UDS_MSG_IDX_STD_TX, 1, UDS_PHYS_RESP_MSG_ID, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_TX */
|
{UDS_MSG_IDX_STD_TX, 1, UDS_PHYS_RESP_MSG_ID, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_TX */
|
||||||
{UDS_MSG_IDX_STD_RX_TEST1, 1, APP_RX_TEST1_MSG_ID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_RX_FUNC */
|
|
||||||
{UDS_MSG_IDX_STD_RX_TEST2, 1, APP_RX_TEST2_MSG_ID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_RX_FUNC */
|
|
||||||
|
|
||||||
{UDS_MSG_IDX_STD_TEST1, 1, APP_TX_TEST1_MSG_ID, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_TX */
|
{UDS_MSG_IDX_STD_RX_BCM_HEAT,1, BCM_HEAT_CANID, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0xFFFFFFFF},
|
||||||
{UDS_MSG_IDX_STD_TEST2, 1, APP_TX_TEST2_MSG_ID, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF}, /* CAN_MSGOBJ_STD_TX */
|
{UDS_MSG_IDX_STD_TX_MFS_HOD, 1, MFS_HOD_CANID, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF},
|
||||||
|
{UDS_MSG_IDX_STD_TX_MFS_KEY, 1, MFS_KEY_CANID, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF},
|
||||||
|
{UDS_MSG_IDX_STD_TX_TEST, 1, 0x222, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, false, 0xFFFFFFFF},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -222,18 +226,32 @@ void TxTestMsg(uint8_t *pdata)
|
|||||||
memcpy(txMsgBuf,pdata,8);
|
memcpy(txMsgBuf,pdata,8);
|
||||||
}
|
}
|
||||||
|
|
||||||
FlexCanBoot_TxMessage(APP_TX_TEST1_MSG_ID, txMsgBuf, 8);
|
FlexCanBoot_TxMessage(0x222, txMsgBuf, 8);
|
||||||
//SEGGER_RTT_printf(0,"test data\n");
|
//SEGGER_RTT_printf(0,"test data\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void TxMessage(CAN_MESSAGE* msg)
|
||||||
|
{
|
||||||
|
FlexCanBoot_TxMessage(msg->MsgId, msg->Data, msg->DLC);
|
||||||
|
}
|
||||||
|
|
||||||
void CANMsgTask(void)//1ms task
|
void CANMsgTask(void)//1ms task
|
||||||
{
|
{
|
||||||
static uint16_t msg_counter=0;
|
static uint16_t msg_counter=0;
|
||||||
FlexCan_FrameStructureType rxMsg;
|
FlexCan_FrameStructureType rxMsg;
|
||||||
msg_counter++;
|
msg_counter++;
|
||||||
|
if (msg_counter % 10 == 0)
|
||||||
|
{
|
||||||
|
//TxTestMsg(NULL);
|
||||||
|
Pack_MFS_HOD_CANmatrix(&mfs_canmatrix_tx.MFS_HOD,&CAN_D_mfs_hod);
|
||||||
|
TxMessage(&CAN_D_mfs_hod);
|
||||||
|
Pack_MFS_KEY_CANmatrix(&mfs_canmatrix_tx.MFS_KEY,&CAN_D_mfs_key);
|
||||||
|
TxMessage(&CAN_D_mfs_key);
|
||||||
|
}
|
||||||
if (msg_counter % 100 == 0)
|
if (msg_counter % 100 == 0)
|
||||||
{
|
{
|
||||||
TxTestMsg(NULL);
|
//TxTestMsg(NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg_counter >= 1000)
|
if (msg_counter >= 1000)
|
||||||
@ -249,10 +267,17 @@ void CANMsgTask(void)//1ms task
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//scm_canmatrix_Receive(&scm_canmatrix_rx,rxMsg.data,rxMsg.id,rxMsg.len);
|
mfs_canmatrix_Receive(&mfs_canmatrix_rx,rxMsg.data,rxMsg.id,rxMsg.len);
|
||||||
//参考
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Uds_Run(&udsObj);
|
Uds_Run(&udsObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CAN_MsgUpdate(void)
|
||||||
|
{
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_TEMP = tempdata;
|
||||||
|
mfs_canmatrix_tx.MFS_HOD.MFS_HOD_HEATING = heating;
|
||||||
|
mfs_canmatrix_tx.MFS_KEY.MFS_ENCODER = 0;
|
||||||
|
}
|
@ -8,20 +8,16 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#include "mcu.h"
|
#include "mcu.h"
|
||||||
#include "uds.h"
|
#include "uds.h"
|
||||||
|
#include "mfs_canmatrix-binutil.h"
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* the defines
|
* the defines
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#define CAN_DATA_BUFFER_SIZE (64u)
|
#define CAN_DATA_BUFFER_SIZE (8u)
|
||||||
|
|
||||||
#define UDS_PHYS_RECV_MSG_ID (0x732)
|
#define UDS_PHYS_RECV_MSG_ID (0x732)
|
||||||
#define UDS_FUNC_RECV_MSG_ID (0x7DF)
|
#define UDS_FUNC_RECV_MSG_ID (0x7DF)
|
||||||
#define UDS_PHYS_RESP_MSG_ID (0x7B2)
|
#define UDS_PHYS_RESP_MSG_ID (0x7B2)
|
||||||
|
|
||||||
#define APP_TX_TEST1_MSG_ID (0x111)
|
|
||||||
#define APP_TX_TEST2_MSG_ID (0x222)
|
|
||||||
#define APP_RX_TEST1_MSG_ID (0x444)
|
|
||||||
#define APP_RX_TEST2_MSG_ID (0x555)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* the typedefs
|
* the typedefs
|
||||||
@ -51,5 +47,7 @@ bool FlexCanBoot_ReadoutMsg(FlexCan_FrameStructureType *pRxMsgObj);
|
|||||||
int8_t FlexCanBoot_TxMessage(uint32_t msgId, const uint8_t* pData, uint8_t size);
|
int8_t FlexCanBoot_TxMessage(uint32_t msgId, const uint8_t* pData, uint8_t size);
|
||||||
|
|
||||||
void CANMsgTask(void);
|
void CANMsgTask(void);
|
||||||
|
void CAN_MsgUpdate(void);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,7 +48,7 @@ __root const app_CfgInfoType app_info = {
|
|||||||
.sAswHeader = ASW_HEAD_MASK,//0x00010400
|
.sAswHeader = ASW_HEAD_MASK,//0x00010400
|
||||||
.appBuildTime = __TIME__,//0x00010404
|
.appBuildTime = __TIME__,//0x00010404
|
||||||
.appBuildDate = __DATE__,//0x00010410
|
.appBuildDate = __DATE__,//0x00010410
|
||||||
.appSW_VERSION = "SW0101_20241211",
|
.appSW_VERSION = "SW0101_20241227",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "mcu.h"
|
#include "mcu.h"
|
||||||
#include "touch/touch_config.h"
|
#include "touch_config.h"
|
||||||
#include "touch/touch_widget_config.h"
|
#include "touch_widget_config.h"
|
||||||
|
|
||||||
typedef struct hod_gpio
|
typedef struct hod_gpio
|
||||||
{
|
{
|
||||||
|
@ -1,174 +0,0 @@
|
|||||||
//user_can_config.c
|
|
||||||
#include "user_can_config.h"
|
|
||||||
#include "mcu.h"
|
|
||||||
#include "key.h"
|
|
||||||
#include "ad_button1.h"
|
|
||||||
|
|
||||||
#include "RTT/SEGGER_RTT.h"
|
|
||||||
|
|
||||||
#include "touch/touch_widget_config.h"
|
|
||||||
|
|
||||||
|
|
||||||
extern McuType mcu;
|
|
||||||
extern uint8_t heating;
|
|
||||||
extern uint8_t heat_level;
|
|
||||||
extern ButtonDrv_ElemCfgType g_button0ElementsCfg[TOUCH_BUTTON0_ELEMENT_NUM];
|
|
||||||
|
|
||||||
|
|
||||||
extern volatile int16_t rawdata;
|
|
||||||
extern volatile int16_t basedata;
|
|
||||||
extern volatile int16_t diffdata;
|
|
||||||
extern volatile uint16_t tempdata;
|
|
||||||
extern volatile uint8_t handing;
|
|
||||||
|
|
||||||
volatile static bool can_txrx_idle[4] = {false, true, true,true};
|
|
||||||
FlexCanDrv_MsgObjType txMsgObj = {0};
|
|
||||||
|
|
||||||
const FlexCanDrv_MsgCfgType msgCfgObj[] = {
|
|
||||||
{0, 1, 0x3F0, false, FLEXCANDRV_MSGTYPE_RX, DLC_BYTE_8, false, true, 0},
|
|
||||||
{1, 1, 0x3F1, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, true, 0},
|
|
||||||
{2, 1, 0x3F2, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, true, 0},
|
|
||||||
{3, 1, 0x400, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, true, 0} //buttons
|
|
||||||
//{3, 1, 0x3F3, false, FLEXCANDRV_MSGTYPE_TX, DLC_BYTE_8, false, true, 0},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* can init. */
|
|
||||||
void app_can_init(void)
|
|
||||||
{
|
|
||||||
PinsDrv_SetMuxModeSel(&mcu.ptb, 15, PINSDRV_MUX_ALT6);/*can rx*/
|
|
||||||
PinsDrv_SetMuxModeSel(&mcu.ptb, 14, PINSDRV_MUX_ALT6);/*can tx*/
|
|
||||||
|
|
||||||
FlexCanDrv_ControllerCfgType flexCanCfg;
|
|
||||||
FlexCanDrv_GetDefaultCfg(&flexCanCfg);
|
|
||||||
FlexCanDrv_BitTimingCalc(&flexCanCfg.bitTiming,80000000, 500000, 7500, 2500, 0);
|
|
||||||
flexCanCfg.clkSrc = FLEXCANDRV_CLKSRC_CHICLK;
|
|
||||||
flexCanCfg.busoffIntEnable = 1;
|
|
||||||
flexCanCfg.errorIntEnable = 1;
|
|
||||||
flexCanCfg.msgNum = sizeof(msgCfgObj) / sizeof(FlexCanDrv_MsgCfgType);
|
|
||||||
flexCanCfg.msgCfg = msgCfgObj;
|
|
||||||
FlexCanDrv_Configure(&(mcu.flexCanDrv), &flexCanCfg);
|
|
||||||
IrqDrv_EnableIrq(CAN_ORed_0_31_MB_IRQn);
|
|
||||||
IrqDrv_EnableIrq(CAN_ORed_IRQn);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* can err, busoff interrupt. */
|
|
||||||
void CAN_ORed_Handler()
|
|
||||||
{
|
|
||||||
if(FlexCanReg_GetBusoffIntFlag(mcu.flexCanDrv.flexCanReg))
|
|
||||||
{
|
|
||||||
FlexCanReg_ClearBusoffIntFlag(mcu.flexCanDrv.flexCanReg);
|
|
||||||
}
|
|
||||||
if(FlexCanReg_GetErrIntFlag(mcu.flexCanDrv.flexCanReg))
|
|
||||||
{
|
|
||||||
FlexCanReg_ClearErrIntFlag(mcu.flexCanDrv.flexCanReg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* can tx, rx interrupt. */
|
|
||||||
void CAN_ORed_0_31_MB_Handler()
|
|
||||||
{
|
|
||||||
FlexCanDrv_MsgObjType msgObj;
|
|
||||||
|
|
||||||
/* rx data. */
|
|
||||||
msgObj.msgBufId = 0;
|
|
||||||
if(FlexCanDrv_GetMsgObjFlag(&mcu.flexCanDrv, &msgObj))
|
|
||||||
{
|
|
||||||
FlexCanDrv_ClearMsgObjFlag(&mcu.flexCanDrv, &msgObj);
|
|
||||||
FlexCanDrv_GetRxMsg(&mcu.flexCanDrv, &msgObj);
|
|
||||||
if (msgObj.dlc > 0)
|
|
||||||
{
|
|
||||||
heating = msgObj.data[0];
|
|
||||||
heat_level = msgObj.data[1];
|
|
||||||
}
|
|
||||||
if (heating > 0)
|
|
||||||
{
|
|
||||||
g_button0ElementsCfg[0].baseFltPosCoef = 8;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_button0ElementsCfg[0].baseFltPosCoef = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* tx data. */
|
|
||||||
for(uint32_t i = 1; i < sizeof(msgCfgObj) / sizeof(FlexCanDrv_MsgCfgType); i++)
|
|
||||||
{
|
|
||||||
msgObj.msgBufId = i;
|
|
||||||
|
|
||||||
if(FlexCanDrv_GetMsgObjFlag(&(mcu.flexCanDrv), &msgObj))
|
|
||||||
{
|
|
||||||
FlexCanDrv_ClearMsgObjFlag(&(mcu.flexCanDrv), &msgObj);
|
|
||||||
can_txrx_idle[i] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*keys can message data*/
|
|
||||||
void can_keys_task(void)
|
|
||||||
{
|
|
||||||
if (can_txrx_idle[3])//KEYS
|
|
||||||
{
|
|
||||||
can_txrx_idle[3] = false;
|
|
||||||
|
|
||||||
txMsgObj.data[0] = (uint8_t)0xFF;
|
|
||||||
txMsgObj.data[1] = (uint8_t)ad_button_state; //left keys
|
|
||||||
txMsgObj.data[2] = (uint8_t)0xFF;
|
|
||||||
txMsgObj.data[3] = (uint8_t)0xFF;
|
|
||||||
txMsgObj.data[4] = (uint8_t)0xFF;
|
|
||||||
txMsgObj.data[5] = (uint8_t)r_switch_state; //right keys
|
|
||||||
txMsgObj.data[6] = (uint8_t)encoder_state; //encoder_state,0x01 roll-up,0x02 roll-down
|
|
||||||
txMsgObj.data[7] = (uint8_t)roll_count;//encoder roll count
|
|
||||||
|
|
||||||
txMsgObj.msgBufId = 3;
|
|
||||||
txMsgObj.dlc = DLC_BYTE_8;
|
|
||||||
FlexCanDrv_SetTxMsg(&(mcu.flexCanDrv), &txMsgObj);
|
|
||||||
FlexCanDrv_TransmitMsg(&(mcu.flexCanDrv), &txMsgObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* can task, send raw, base, diff, temp, hand msg per 100ms. */
|
|
||||||
void can_task()
|
|
||||||
{
|
|
||||||
if (can_txrx_idle[1])//hod
|
|
||||||
{
|
|
||||||
can_txrx_idle[1] = false;
|
|
||||||
txMsgObj.data[0] = (uint8_t)((rawdata >> 8) & 0xFF);
|
|
||||||
txMsgObj.data[1] = (uint8_t)((rawdata >> 0) & 0xFF);
|
|
||||||
txMsgObj.data[2] = (uint8_t)((basedata >> 8) & 0xFF);
|
|
||||||
txMsgObj.data[3] = (uint8_t)((basedata >> 0) & 0xFF);
|
|
||||||
txMsgObj.data[4] = (uint8_t)((diffdata >> 8) & 0xFF);
|
|
||||||
txMsgObj.data[5] = (uint8_t)((diffdata >> 0) & 0xFF);
|
|
||||||
txMsgObj.data[6] = tempdata; //aa
|
|
||||||
|
|
||||||
txMsgObj.data[7] = heating << 1 | handing;
|
|
||||||
txMsgObj.msgBufId = 1;
|
|
||||||
txMsgObj.dlc = DLC_BYTE_8;
|
|
||||||
FlexCanDrv_SetTxMsg(&(mcu.flexCanDrv), &txMsgObj);
|
|
||||||
FlexCanDrv_TransmitMsg(&(mcu.flexCanDrv), &txMsgObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (can_txrx_idle[2])//
|
|
||||||
{
|
|
||||||
can_txrx_idle[2] = false;
|
|
||||||
txMsgObj.data[0] = handing;
|
|
||||||
txMsgObj.data[1] = 0;
|
|
||||||
txMsgObj.data[2] = 0;
|
|
||||||
txMsgObj.data[3] = 0;
|
|
||||||
txMsgObj.data[4] = 0;
|
|
||||||
txMsgObj.data[5] = 0;
|
|
||||||
txMsgObj.data[6] = 0;
|
|
||||||
txMsgObj.data[7] = 0;
|
|
||||||
txMsgObj.msgBufId = 2;
|
|
||||||
txMsgObj.dlc = DLC_BYTE_8;
|
|
||||||
FlexCanDrv_SetTxMsg(&(mcu.flexCanDrv), &txMsgObj);
|
|
||||||
FlexCanDrv_TransmitMsg(&(mcu.flexCanDrv), &txMsgObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SEGGER_RTT_printf(0,"can task");
|
|
||||||
}/*can_task()*/
|
|
@ -1,8 +0,0 @@
|
|||||||
//user_can_config.h
|
|
||||||
#ifndef _USER_CAN_CONFIG_H
|
|
||||||
#define _USER_CAN_CONFIG_H
|
|
||||||
|
|
||||||
void app_can_init(void);
|
|
||||||
void can_keys_task(void);
|
|
||||||
void can_task(void);
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user