Skip to content

Commit c03047a

Browse files
committed
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
2 parents eb79397 + 24cf724 commit c03047a

File tree

587 files changed

+60901
-7312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+60901
-7312
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update
99

1010
RUN apt-get upgrade -y
1111

12-
RUN apt-get install -y vim git wget python3 python-is-python3 pip gcc-arm-none-eabi scons libncurses5-dev
12+
RUN apt-get install -y vim git wget python3 python-is-python3 pip gcc-arm-none-eabi libncurses5-dev
1313

1414
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-system-arm
1515

@@ -34,7 +34,7 @@ RUN git clone https://github.com/RT-Thread/packages.git /root/.env/packages/pack
3434

3535
ENV PATH="/root/.env/tools/scripts:$PATH"
3636

37-
RUN pip install requests psutil kconfiglib tqdm -qq
37+
RUN pip install scons requests psutil kconfiglib tqdm -qq
3838

3939
ENV RTT_EXEC_PATH=/usr/bin
4040

.github/workflows/action_tools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
if: ${{ success() }}
7878
run: |
7979
echo "Test to dist project"
80-
scons --dist --project-name=project -C $TEST_BSP_ROOT
80+
scons --dist -C $TEST_BSP_ROOT
8181
scons --dist-ide -C $TEST_BSP_ROOT
8282
ls $TEST_BSP_ROOT
8383
ls $TEST_BSP_ROOT/dist

.github/workflows/bsp_buildings.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ jobs:
188188
- "stm32/stm32g474-st-nucleo"
189189
- "stm32/stm32h563-st-nucleo"
190190
- "stm32/stm32h503-st-nucleo"
191+
- "stm32/stm32h723-st-nucleo"
191192
- "stm32/stm32h743-armfly-v7"
192193
- "stm32/stm32h743-atk-apollo"
193194
- "stm32/stm32h743-openmv-h7plus"
@@ -342,7 +343,7 @@ jobs:
342343
- "qemu-virt64-aarch64"
343344
- "raspberry-pi/raspi3-64"
344345
- "raspberry-pi/raspi4-64"
345-
- "rockchip/rk3568"
346+
#- "rockchip/rk3568" too long
346347
- "phytium/aarch64"
347348
- RTT_BSP: "riscv-none"
348349
RTT_TOOL_CHAIN: "sourcery-riscv-none-embed"

.github/workflows/doxygen.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
name: doc_doxygen
22
on:
3+
pull_request:
4+
branches:
5+
- master
6+
paths:
7+
- 'documentation/doxygen/**'
8+
- 'src/**'
9+
- 'include/**'
10+
- 'components/drivers/include/drivers/**'
11+
- 'components/dfs/dfs_v2/include/**'
12+
- 'components/dfs/dfs_v2/src/**'
13+
- 'components/finsh/**'
314
# Runs at 16:00 UTC (BeiJing 00:00) on the 30st of every month
415
schedule:
516
- cron: '0 16 30 * *'
617
workflow_dispatch:
718

819
jobs:
920
build:
10-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-22.04
1122
name: doxygen_doc generate
1223
if: github.repository_owner == 'RT-Thread'
1324
steps:
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
scons.args: &scons
2+
scons_arg:
3+
- '--strict'
4+
devices.gpio:
5+
<<: *scons
6+
kconfig:
7+
- CONFIG_RT_USING_PIN=y
8+
- CONFIG_BSP_USING_GPIO=y
9+
devices.uart:
10+
kconfig:
11+
- CONFIG_RT_USING_SERIAL=y
12+
- CONFIG_RT_USING_SERIAL_V1=y
13+
- CONFIG_BSP_USING_UART=y
14+
devices.i2c:
15+
kconfig:
16+
- CONFIG_RT_USING_I2C=y
17+
- CONFIG_BSP_USING_I2C=y
18+
devices.hwi2c:
19+
depends:
20+
- devices.i2c
21+
kconfig:
22+
- CONFIG_BSP_USING_HW_I2C=y
23+
devices.swi2c:
24+
depends:
25+
- devices.i2c
26+
kconfig:
27+
- CONFIG_BSP_USING_SW_I2C=y
28+
- CONFIG_BSP_USING_SW_I2C0=y
29+
devices.spi:
30+
kconfig:
31+
- CONFIG_RT_USING_SPI=y
32+
- CONFIG_BSP_USING_SPI=y
33+
- CONFIG_BSP_USING_SPI2=y
34+
devices.hwtimer:
35+
kconfig:
36+
- CONFIG_RT_USING_HWTIMER=y
37+
- CONFIG_BSP_USING_HWTIMER=y
38+
- CONFIG_BSP_USING_TIMER0=y
39+
devices.adc:
40+
kconfig:
41+
- CONFIG_RT_USING_ADC=y
42+
- CONFIG_BSP_USING_ADC=y
43+
- CONFIG_BSP_USING_ADC1=y
44+
devices.pwm:
45+
kconfig:
46+
- CONFIG_RT_USING_PWM=y
47+
- CONFIG_BSP_USING_PWM=y
48+
- CONFIG_BSP_USING_PWM0=y
49+
devices.ble:
50+
kconfig:
51+
- CONFIG_BSP_USING_BLE=y
52+
devices.wifi:
53+
kconfig:
54+
- CONFIG_BSP_USING_WIFI=y
55+
- CONFIG_RT_USING_WIFI=y
56+
- CONFIG_RT_USING_LWIP=y
57+
- CONFIG_RT_USING_NETDEV=y

bsp/ESP32_C3/drivers/Kconfig

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,28 @@ menu "On-chip Peripheral Drivers"
7272
default n
7373
select RT_USING_I2C
7474
if BSP_USING_I2C
75-
config BSP_USING_I2C0
76-
bool "Enable I2C0"
75+
menuconfig BSP_USING_HW_I2C
76+
bool "Enable HardWare I2C"
7777
default n
78+
79+
menuconfig BSP_USING_SW_I2C
80+
bool "Enable SoftWare I2C"
81+
default n
82+
if BSP_USING_SW_I2C
83+
config BSP_USING_SW_I2C0
84+
bool "Enable SoftWare I2C0"
85+
default n
86+
if BSP_USING_SW_I2C0
87+
config BSP_SW_I2C0_SDA_PIN
88+
int "SWI2C0 sda pin number"
89+
range 0 21
90+
default 18
91+
config BSP_SW_I2C0_SCL_PIN
92+
int "SWI2C0 scl pin number"
93+
range 0 21
94+
default 19
95+
endif
96+
endif
7897
endif
7998

8099
menuconfig BSP_USING_SPI

bsp/ESP32_C3/drivers/SConscript

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ if GetDepend('BSP_USING_ADC'):
1717

1818
if GetDepend('BSP_USING_I2C'):
1919
src += ['drv_hw_i2c.c']
20+
21+
if GetDepend('BSP_USING_SW_I2C'):
22+
src += ['drv_sw_i2c.c']
2023

2124
if GetDepend('BSP_USING_PWM'):
2225
src += ['drv_pwm.c']

bsp/ESP32_C3/drivers/board.c

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
/*
2-
* Copyright (c) 2021-2022, RT-Thread Development Team
2+
* Copyright (c) 2021-2024 RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2022-06-02 supperthomas first version
9+
* 2024-12-08 wumingzi support rt_hw_us_delay
910
*/
1011

1112
#include <rtthread.h>
13+
#include "rttypes.h"
1214
#include "hal/systimer_hal.h"
1315
#include "hal/systimer_ll.h"
1416
#include "esp_private/panic_internal.h"
1517
#include "esp_private/systimer.h"
1618
#include "esp_private/periph_ctrl.h"
1719
#include "esp_intr_alloc.h"
1820
#include "esp_attr.h"
21+
#include "esp_timer.h"
22+
#include "driver/gptimer.h"
1923

2024
static systimer_hal_context_t systimer_hal;
2125
IRAM_ATTR void rt_SysTickIsrHandler(void *arg)
@@ -57,3 +61,31 @@ void rt_hw_board_init(void)
5761
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
5862
#endif
5963
}
64+
65+
static gptimer_handle_t gptimer_hw_us = NULL;
66+
67+
static int delay_us_init(void)
68+
{
69+
gptimer_config_t timer_config = {
70+
.clk_src = GPTIMER_CLK_SRC_DEFAULT,
71+
.direction = GPTIMER_COUNT_UP,
72+
.resolution_hz = 1 * 1000 * 1000, /* 1MHz, 1 tick = 1us*/
73+
};
74+
ESP_ERROR_CHECK(gptimer_new_timer(&timer_config, &gptimer_hw_us));
75+
ESP_ERROR_CHECK(gptimer_enable(gptimer_hw_us));
76+
return RT_EOK;
77+
}
78+
INIT_DEVICE_EXPORT(delay_us_init);
79+
80+
void rt_hw_us_delay(rt_uint32_t us)
81+
{
82+
uint64_t count = 0;
83+
ESP_ERROR_CHECK(gptimer_start(gptimer_hw_us));
84+
ESP_ERROR_CHECK(gptimer_set_raw_count(gptimer_hw_us, 0));
85+
/* Retrieve the timestamp at anytime*/
86+
while(count < (uint64_t)us)
87+
{
88+
ESP_ERROR_CHECK(gptimer_get_raw_count(gptimer_hw_us, &count));
89+
}
90+
ESP_ERROR_CHECK(gptimer_stop(gptimer_hw_us));
91+
}

bsp/ESP32_C3/drivers/board.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
/*
2-
* Copyright (c) 2021-2022, RT-Thread Development Team
2+
* Copyright (c) 2021-2024 RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2022-06-02 supperthomas first version
9+
* 2024-12-08 wumingzi support rt_hw_us_delay
910
*/
1011

1112
#ifndef __BOARD_H__
1213
#define __BOARD_H__
1314

1415
#include <rtconfig.h>
16+
#include "rttypes.h"
1517

1618
#ifdef __cplusplus
1719
extern "C" {
1820
#endif
19-
2021
void rt_hw_board_init(void);
22+
void rt_hw_us_delay(rt_uint32_t us);
2123

2224
#ifdef __cplusplus
2325
}
2426
#endif
25-
26-
#endif
27-
27+
#endif

bsp/ESP32_C3/drivers/drv_gpio.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
* Copyright (c) 2021-2022, RT-Thread Development Team
2+
* Copyright (c) 2021-2024 RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2022-06-03 supperthomas first version
9-
*
9+
* 2024-12-08 wumingzi support open drain mode for soft i2c
1010
*/
1111

1212
#include <rtthread.h>
@@ -37,9 +37,14 @@ static void mcu_pin_mode(rt_device_t dev, rt_base_t pin, rt_uint8_t mode)
3737
io_conf.pull_down_en = 0;
3838
io_conf.pull_up_en = 0;
3939
gpio_config(&io_conf);
40-
if (mode == PIN_MODE_OUTPUT)
40+
switch (mode)
4141
{
42-
gpio_set_direction(pin, GPIO_MODE_OUTPUT);
42+
case PIN_MODE_INPUT:
43+
gpio_set_direction(pin, GPIO_MODE_INPUT);
44+
case PIN_MODE_OUTPUT:
45+
gpio_set_direction(pin, GPIO_MODE_OUTPUT);
46+
case PIN_MODE_OUTPUT_OD:
47+
gpio_set_direction(pin, GPIO_MODE_INPUT_OUTPUT_OD);
4348
}
4449
/*TODO:set gpio out put mode */
4550
}
@@ -84,4 +89,4 @@ int rt_hw_pin_init(void)
8489
}
8590
INIT_BOARD_EXPORT(rt_hw_pin_init);
8691

87-
#endif /* RT_USING_PIN */
92+
#endif /* RT_USING_PIN */

0 commit comments

Comments
 (0)