Skip to content

Commit bc4de27

Browse files
wdfk-progRbb666
authored andcommitted
feat:添加rtt_isotp-c软件包
1 parent 761ff4a commit bc4de27

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

peripherals/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ source "$PKGS_DIR/packages/peripherals/sean_ws2812b/Kconfig"
8484
source "$PKGS_DIR/packages/peripherals/ic74hc165/Kconfig"
8585
source "$PKGS_DIR/packages/peripherals/ist8310/Kconfig"
8686
source "$PKGS_DIR/packages/peripherals/ST7789_SPI/Kconfig"
87+
source "$PKGS_DIR/packages/peripherals/rtt_isotp-c/Kconfig"
8788

8889
if RT_VER_NUM > 0x40101
8990
source "$PKGS_DIR/packages/peripherals/spi-tools/Kconfig"

peripherals/rtt_isotp-c/Kconfig

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
menuconfig PKG_USING_ISOTP_C
2+
bool "ISO-TP:ISO 15765-2 (also known as ISO-TP) protocol with CAN multi-link and event-driven support"
3+
default n
4+
select RT_USING_HEAP
5+
select RT_USING_CAN
6+
help
7+
A C library that implements the ISO 15765-2 (also known as ISO-TP) protocol.
8+
This package provides an adapter layer for RT-Thread with multi-link and event-driven support.
9+
10+
if PKG_USING_ISOTP_C
11+
12+
menu "Adapter Layer Configuration"
13+
config PKG_ISOTP_C_POLL_THREAD_STACK_SIZE
14+
int "Stack size for the isotp-c polling thread"
15+
default 1024
16+
help
17+
This thread periodically calls isotp_poll() for all active links.
18+
19+
config PKG_ISOTP_C_POLL_THREAD_PRIORITY
20+
int "Priority for the isotp-c polling thread"
21+
default 20
22+
help
23+
Priority of the polling thread.
24+
25+
config PKG_ISOTP_C_POLL_INTERVAL_MS
26+
int "Polling interval in milliseconds"
27+
default 5
28+
help
29+
The interval at which the polling thread runs to update link states.
30+
A smaller value gives faster response but higher CPU usage.
31+
endmenu
32+
33+
menu "ISO-TP Protocol Parameters"
34+
config ISO_TP_DEFAULT_BLOCK_SIZE
35+
int "Block Size (BS)"
36+
default 8
37+
help
38+
ISO-TP Block Size (BS). Max number of consecutive frames the receiver
39+
can receive without sending a new Flow Control frame. (0 = infinite)
40+
41+
config ISO_TP_DEFAULT_ST_MIN_US
42+
int "Minimum Separation Time (STmin) in microseconds"
43+
default 0
44+
help
45+
ISO-TP Separation Time (STmin). Specifies the minimum time gap
46+
allowed between the transmission of consecutive frames.
47+
48+
config ISO_TP_MAX_WFT_NUMBER
49+
int "Max number of Wait Frame Transmissions (WFTmax)"
50+
default 1
51+
help
52+
ISO-TP WFTmax. Indicates how many Wait Frames (FC.WT) can be
53+
transmitted by the receiver in a row if it's not ready to receive.
54+
55+
config ISO_TP_DEFAULT_RESPONSE_TIMEOUT_US
56+
int "Response timeout in microseconds (Ar/As, Br/Bs, Cr/Cs)"
57+
default 100000
58+
help
59+
Default timeout for waiting for a response during a multi-frame
60+
send or receive (e.g., waiting for a Flow Control frame).
61+
62+
config ISO_TP_FRAME_PADDING
63+
bool "Enable CAN frame padding"
64+
default n
65+
help
66+
If enabled, all transmitted CAN frames will be padded to 8 bytes.
67+
This is required by some ECUs.
68+
69+
if ISO_TP_FRAME_PADDING
70+
config ISO_TP_FRAME_PADDING_VALUE
71+
hex "Padding value"
72+
default 0xAA
73+
help
74+
The byte value used for padding CAN frames if padding is enabled.
75+
endif
76+
77+
# The following options are mandatory for the event-driven adapter
78+
config ISO_TP_USER_SEND_CAN_ARG
79+
bool "Enable user argument for send_can function"
80+
default y
81+
help
82+
Adds a 'void *user_send_can_arg' to isotp_user_send_can.
83+
This is ESSENTIAL for multi-link/multi-CAN support. DO NOT DISABLE.
84+
85+
config ISO_TP_TRANSMIT_COMPLETE_CALLBACK
86+
bool "Enable transmit complete callback"
87+
default y
88+
help
89+
Enables the isotp_set_tx_done_cb function.
90+
This is ESSENTIAL for the event-driven adapter. DO NOT DISABLE.
91+
92+
config ISO_TP_RECEIVE_COMPLETE_CALLBACK
93+
bool "Enable receive complete callback"
94+
default y
95+
help
96+
Enables the isotp_set_rx_done_cb function.
97+
This is ESSENTIAL for the event-driven adapter. DO NOT DISABLE.
98+
endmenu
99+
100+
config PKG_ISOTP_C_EXAMPLES
101+
bool "Enable isotp-c examples"
102+
default n
103+
select BSP_USING_CAN1
104+
select BSP_USING_CAN2
105+
help
106+
Enable examples for isotp-c package, demonstrating communication
107+
between two CAN interfaces.
108+
109+
config PKG_ISOTP_C_VERSION
110+
string "isotp-c version"
111+
default "latest"
112+
113+
endif
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "rtt_isotp-c",
3+
"description": "Adapter layer for CAN TP (ISO 15765-2). Designed for scenarios involving multi-frame transmission (can be interfaced to implement protocols such as YMODEM).",
4+
"description_zh": "用于CAN-TP(ISO15765-2)的适配层。用于多帧传输的场景而设计(可对接实现ymodem等协议)",
5+
"enable": "PKG_USING_ISOTP_C",
6+
"keywords": [
7+
"rtt_isotp-c"
8+
],
9+
"category": "peripherals",
10+
"author": {
11+
"name": "hly",
12+
"email": "[email protected]",
13+
"github": "wdfk-prog"
14+
},
15+
"license": "LGPL-2.1",
16+
"repository": "https://github.com/wdfk-prog/rtt_isotp-c.git",
17+
"icon": "unknown",
18+
"homepage": "https://github.com/wdfk-prog/rtt_isotp-c.git#readme",
19+
"doc": "https://github.com/wdfk-prog/rtt_isotp-c.git#readme",
20+
"readme": "Adapter layer for CAN TP (ISO 15765-2). Designed for scenarios involving multi-frame transmission (can be interfaced to implement protocols such as YMODEM).",
21+
"site": [
22+
{
23+
"version": "latest",
24+
"URL": "https://github.com/wdfk-prog/rtt_isotp-c.git",
25+
"filename": "rtt_isotp_c.zip",
26+
"VER_SHA": "master"
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)