Skip to content

Commit 3ba1670

Browse files
authored
add libcrc package (#1845)
* add libcrc package
1 parent 6b257d9 commit 3ba1670

File tree

3 files changed

+147
-0
lines changed

3 files changed

+147
-0
lines changed

misc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ source "$PKGS_DIR/packages/misc/vi/Kconfig"
2626
source "$PKGS_DIR/packages/misc/ki/Kconfig"
2727
source "$PKGS_DIR/packages/misc/armv7m_dwt/Kconfig"
2828
source "$PKGS_DIR/packages/misc/crclib/Kconfig"
29+
source "$PKGS_DIR/packages/misc/libcrc/Kconfig"
2930
source "$PKGS_DIR/packages/misc/lwgps/Kconfig"
3031
source "$PKGS_DIR/packages/misc/state_machine/Kconfig"
3132
source "$PKGS_DIR/packages/misc/design_pattern/Kconfig"

misc/libcrc/Kconfig

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
2+
# Kconfig file for package libcrc
3+
menuconfig PKG_USING_LIBCRC
4+
bool "libcrc:Multi platform MIT licensed CRC library in C."
5+
default n
6+
7+
if PKG_USING_LIBCRC
8+
9+
config PKG_LIBCRC_PATH
10+
string
11+
default "/packages/misc/libcrc"
12+
13+
choice
14+
prompt "Version"
15+
help
16+
Select the package version
17+
18+
config PKG_USING_LIBCRC_V100
19+
bool "v1.0.0"
20+
21+
config PKG_USING_LIBCRC_LATEST_VERSION
22+
bool "latest"
23+
endchoice
24+
25+
config PKG_LIBCRC_CRC8
26+
bool "crc8"
27+
default n
28+
29+
if PKG_LIBCRC_CRC8
30+
config LIBCRC_USING_CRC8
31+
bool "using 8 bit crc"
32+
default n
33+
endif
34+
35+
config PKG_LIBCRC_CRC16
36+
bool "crc16"
37+
default n
38+
39+
if PKG_LIBCRC_CRC16
40+
config LIBCRC_USING_CRC16
41+
bool "using 16 bit crc"
42+
default n
43+
44+
config LIBCRC_USING_CRC_CCITT_1D0F
45+
bool "using ccitt crc, 0x1D0F"
46+
default n
47+
48+
config LIBCRC_USING_CRC_CCITT_FFFF
49+
bool "using ccitt crc, 0xFFFF"
50+
default n
51+
config LIBCRC_USING_CRC_DNP
52+
bool "using dnp crc"
53+
default n
54+
55+
config LIBCRC_USING_CRC_KERMIT
56+
bool "using kermit crc"
57+
default n
58+
59+
config LIBCRC_USING_CRC_MODBUS
60+
bool "using modbus crc"
61+
default n
62+
63+
config LIBCRC_USING_CRC_SICK
64+
bool "using sick crc"
65+
default n
66+
67+
config LIBCRC_USING_CRC_XMODEM
68+
bool "using xmodem crc"
69+
default n
70+
endif
71+
72+
config PKG_LIBCRC_CRC32
73+
bool "crc32"
74+
default n
75+
76+
if PKG_LIBCRC_CRC32
77+
config LIBCRC_USING_CRC32
78+
bool "using 32 bit crc"
79+
default n
80+
endif
81+
82+
config PKG_LIBCRC_CRC64
83+
bool "crc64"
84+
default n
85+
86+
if PKG_LIBCRC_CRC64
87+
config LIBCRC_USING_CRC64_ECMA
88+
bool "using 64 bit ecma crc"
89+
default n
90+
91+
config LIBCRC_USING_CRC64_WE
92+
bool "using 64 bit we crc"
93+
default n
94+
endif
95+
96+
config PKG_USING_CHECKSUM_NMEA
97+
bool "using nmea checksum"
98+
default n
99+
100+
config PKG_USING_LIBCRC_SAMPLE
101+
bool "using sample crc"
102+
default n
103+
104+
105+
config PKG_LIBCRC_VER
106+
string
107+
default "v1.0.0" if PKG_USING_LIBCRC_V100
108+
default "latest" if PKG_USING_LIBCRC_LATEST_VERSION
109+
110+
endif
111+

misc/libcrc/package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "libcrc",
3+
"description": "A crc verification calculation function library for porting libcrc.",
4+
"description_zh": "一个移植libcrc的crc校验计算函数库。",
5+
"enable": "PKG_USING_LIBCRC",
6+
"keywords": [
7+
"libcrc",
8+
"crc",
9+
"rt-thread"
10+
],
11+
"category": "misc",
12+
"author": {
13+
"name": "wangwang105",
14+
"email": "[email protected]",
15+
"github": "wangwang105"
16+
},
17+
"license": "MIT",
18+
"repository": "https://github.com/wangwang105/rtt-libcrc.git",
19+
"icon": "https://www.rt-thread.org/qa/template/fxiaomi/style/image/logo.png",
20+
"homepage": "https://github.com/wangwang105/rtt-libcrc.git#readme",
21+
"doc": "unknown",
22+
"site": [
23+
{
24+
"version": "v1.0.0",
25+
"URL": "https://github.com/wangwang105/rtt-libcrc/archive/refs/tags/v1.0.0.zip",
26+
"filename": "libcrc-1.0.0.zip"
27+
},
28+
{
29+
"version": "latest",
30+
"URL": "https://github.com/wangwang105/rtt-libcrc.git",
31+
"filename": "rtt-libcrc-latest.zip",
32+
"VER_SHA": "main"
33+
}
34+
]
35+
}

0 commit comments

Comments
 (0)