Skip to content

Commit f0a5d00

Browse files
kurisaWRbb666
authored andcommitted
ist8310 support rt-thread
1 parent a086936 commit f0a5d00

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

peripherals/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ source "$PKGS_DIR/packages/peripherals/ikun-485/Kconfig"
8282
source "$PKGS_DIR/packages/peripherals/Servo_sg90/Kconfig"
8383
source "$PKGS_DIR/packages/peripherals/sean_ws2812b/Kconfig"
8484
source "$PKGS_DIR/packages/peripherals/ic74hc165/Kconfig"
85+
source "$PKGS_DIR/packages/peripherals/ist8310/Kconfig"
8586

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

peripherals/ist8310/Kconfig

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# drivers/sensors/ist8310/Kconfig
2+
3+
menuconfig PKG_USING_IST8310
4+
bool "IST8310: 3-axis magnetometer driver package"
5+
default n
6+
select RT_USING_I2C
7+
help
8+
A driver package for IST8310 3-axis magnetometer
9+
10+
if PKG_USING_IST8310
11+
12+
config PKG_IST8310_PATH
13+
string
14+
default "/packages/peripherals/ist8310"
15+
16+
choice
17+
prompt "Version"
18+
default PKG_USING_IST8310_LATEST_VERSION
19+
help
20+
Select the package version
21+
22+
config PKG_USING_IST8310_LATEST_VERSION
23+
bool "latest"
24+
endchoice
25+
26+
config PKG_IST8310_VER
27+
string
28+
default "latest" if PKG_USING_IST8310_LATEST_VERSION
29+
30+
config PKG_USING_IST8310_SAMPLE
31+
bool "Enable ist8310 sample"
32+
default n
33+
if PKG_USING_IST8310_SAMPLE
34+
config IST8310_SAMPLE_I2C_DEV_NAME
35+
string "i2c dev name with ist8310"
36+
default "i2c2"
37+
endif
38+
39+
config IST8310_USING_MAG
40+
bool "Enable ist8310 mag"
41+
default y
42+
help
43+
Enable magnetometer function
44+
45+
config IST8310_USING_SOFT_FILTER
46+
bool "Enable software filter"
47+
default n
48+
depends on IST8310_USING_MAG
49+
help
50+
Enable software filter for smoothing data
51+
52+
if IST8310_USING_SOFT_FILTER
53+
config IST8310_SAMPLE_PERIOD
54+
int "Sample period (ms)"
55+
default 100
56+
range 10 1000
57+
help
58+
Set the sampling period in milliseconds
59+
60+
config IST8310_AVERAGE_TIMES
61+
int "Average times"
62+
default 5
63+
range 1 20
64+
help
65+
Set the number of samples for averaging
66+
endif
67+
68+
endif

peripherals/ist8310/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "ist8310",
3+
"description": "A driver package for IST8310 3-axis magnetometer",
4+
"description_zh": "IST8310三轴磁力计驱动软件包",
5+
"enable": "PKG_USING_IST8310",
6+
"keywords": [
7+
"ist8310",
8+
"magnetometer"
9+
],
10+
"category": "peripherals",
11+
"author": {
12+
"name": "Yuqiang Wang",
13+
"email": "[email protected]",
14+
"github": "kurisaW"
15+
},
16+
"license": "Apache-2.0",
17+
"repository": "https://github.com/kurisaW/ist8310",
18+
"homepage": "https://github.com/kurisaW/ist8310#readme",
19+
"site": [
20+
{
21+
"version": "v1.0.0",
22+
"URL": "https://github.com/kurisaW/ist8310/archive/refs/tags/v1.0.0.zip",
23+
"filename": "ist8310-1.0.0.zip",
24+
"VER_SHA": ""
25+
},
26+
{
27+
"version": "latest",
28+
"URL": "https://github.com/kurisaW/ist8310.git",
29+
"filename": "ist8310.zip",
30+
"VER_SHA": "main"
31+
}
32+
],
33+
"doc": "https://github.com/kurisaW/ist8310/blob/main/README.md"
34+
}

0 commit comments

Comments
 (0)