Skip to content

Commit 9e31279

Browse files
Ze-HouRbb666
authored andcommitted
bsp: k230: add i2c driver
Requirement: The BSP for the k230 platform in the RT-Thread repository does not yet have an I2C driver. Solution: Provide I2C driver for the k230 platform in the RT-Thread repository. 1. support i2c master mode Signed-off-by: Ze-Hou <[email protected]>
1 parent e4f014e commit 9e31279

File tree

9 files changed

+1491
-1
lines changed

9 files changed

+1491
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
scons.args: &scons
2+
scons_arg:
3+
- '--strict'
4+
devices.i2c:
5+
<<: *scons
6+
kconfig:
7+
- CONFIG_RT_USING_I2C=y
8+
- CONFIG_BSP_USING_I2C=y
9+
- CONFIG_BSP_USING_I2C0=y

bsp/k230/.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ CONFIG_FINSH_THREAD_STACK_SIZE=8192
227227
CONFIG_FINSH_USING_HISTORY=y
228228
CONFIG_FINSH_HISTORY_LINES=5
229229
# CONFIG_FINSH_USING_WORD_OPERATION is not set
230+
# CONFIG_FINSH_USING_FUNC_EXT is not set
230231
CONFIG_FINSH_USING_SYMTAB=y
231232
CONFIG_FINSH_CMD_SIZE=80
232233
CONFIG_MSH_USING_BUILT_IN_COMMANDS=y
@@ -425,6 +426,7 @@ CONFIG_RT_USING_POSIX_TIMER=y
425426
#
426427
CONFIG_RT_USING_SAL=y
427428
CONFIG_SAL_INTERNET_CHECK=y
429+
CONFIG_SOCKET_TABLE_STEP_LEN=4
428430

429431
#
430432
# Docking with protocol stacks
@@ -1617,6 +1619,7 @@ CONFIG_PKG_ZLIB_VER="latest"
16171619
#
16181620
# Drivers Configuration
16191621
#
1622+
# CONFIG_BSP_USING_I2C is not set
16201623
# CONFIG_BSP_USING_RTC is not set
16211624
# CONFIG_BSP_USING_ADC is not set
16221625
# CONFIG_BSP_USING_TS is not set

bsp/k230/board/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
menu "Drivers Configuration"
2+
menuconfig BSP_USING_I2C
3+
bool "Enable I2C"
4+
select RT_USING_I2C
5+
default n
6+
7+
if BSP_USING_I2C
8+
config BSP_USING_I2C0
9+
bool "Enable I2C0"
10+
default n
11+
12+
config BSP_USING_I2C1
13+
bool "Enable I2C1"
14+
default n
15+
16+
config BSP_USING_I2C2
17+
bool "Enable I2C2"
18+
default n
19+
20+
config BSP_USING_I2C3
21+
bool "Enable I2C3"
22+
default n
23+
24+
config BSP_USING_I2C4
25+
bool "Enable I2C4"
26+
default n
27+
28+
endif
229

330
config BSP_USING_RTC
431
bool "Enable RTC"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RT-Thread building script for I2C component
2+
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
src = Glob('*.c')
7+
CPPPATH = [cwd]
8+
9+
group = DefineGroup('I2C', src, depend = ['BSP_USING_I2C'], CPPPATH = CPPPATH)
10+
11+
Return('group')

0 commit comments

Comments
 (0)