Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46254178
rt-thread
提交
d0c0e4e6
R
rt-thread
项目概览
weixin_46254178
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d0c0e4e6
编写于
9月 07, 2021
作者:
J
jacycle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.规范代码风格及命名规则
2.增加.ignore_format.yml
上级
83636c46
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
93 addition
and
534 deletion
+93
-534
bsp/hc32l136/.ignore_format.yml
bsp/hc32l136/.ignore_format.yml
+9
-0
bsp/hc32l136/applications/main.c
bsp/hc32l136/applications/main.c
+2
-3
bsp/hc32l136/board/board.c
bsp/hc32l136/board/board.c
+2
-2
bsp/hc32l136/board/board.h
bsp/hc32l136/board/board.h
+2
-4
bsp/hc32l136/drivers/drv_dma.h
bsp/hc32l136/drivers/drv_dma.h
+0
-39
bsp/hc32l136/drivers/drv_gpio.c
bsp/hc32l136/drivers/drv_gpio.c
+16
-84
bsp/hc32l136/drivers/drv_gpio.h
bsp/hc32l136/drivers/drv_gpio.h
+2
-2
bsp/hc32l136/drivers/drv_soft_i2c.c
bsp/hc32l136/drivers/drv_soft_i2c.c
+0
-207
bsp/hc32l136/drivers/drv_soft_i2c.h
bsp/hc32l136/drivers/drv_soft_i2c.h
+0
-128
bsp/hc32l136/drivers/drv_usart.c
bsp/hc32l136/drivers/drv_usart.c
+4
-9
bsp/hc32l136/drivers/drv_usart.h
bsp/hc32l136/drivers/drv_usart.h
+2
-2
bsp/hc32l136/project.uvoptx
bsp/hc32l136/project.uvoptx
+29
-29
bsp/hc32l136/project.uvprojx
bsp/hc32l136/project.uvprojx
+25
-25
未找到文件。
bsp/hc32l136/.ignore_format.yml
0 → 100644
浏览文件 @
d0c0e4e6
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
file_path
:
dir_path
:
-
libraries
\ No newline at end of file
bsp/hc32l136/applications/main.c
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 202
0-10-30 CDT
first version
* 202
1-09-07 PJQ
first version
*/
...
...
@@ -61,7 +61,6 @@ void key_handler(void *param)
******************************************************************************/
int32_t
main
(
void
)
{
//rt_kprintf("Os is Start!!! \n");
rt_pin_mode
(
LED_PIN
,
PIN_MODE_OUTPUT
);
rt_pin_attach_irq
(
KEY_PIN
,
PIN_IRQ_MODE_FALLING
,
key_handler
,
RT_NULL
);
rt_pin_irq_enable
(
KEY_PIN
,
PIN_IRQ_ENABLE
);
...
...
bsp/hc32l136/board/board.c
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 202
0-10-30 CDT
first version
* 202
1-08-19 pjq
first version
*/
...
...
bsp/hc32l136/board/board.h
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-10-30 CDT first version
* 2021-01-18 CDT MOdify SRAM_SIZE
* 2021-08-19 pjq first version
*/
#ifndef __BOARD_H__
...
...
@@ -35,7 +34,6 @@ extern int __bss_end;
#endif
#ifdef __ICCARM__
// Use *.icf ram symbal, to avoid hardcode.
#define HEAP_END SRAM_END
#else
#define HEAP_END SRAM_END
...
...
bsp/hc32l136/drivers/drv_dma.h
已删除
100644 → 0
浏览文件 @
83636c46
/*
* Copyright (C) 2020, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-10-30 CDT first version
*/
#ifndef __DRV_DMA_H__
#define __DRV_DMA_H__
/*******************************************************************************
* Include files
******************************************************************************/
#include <rtthread.h>
#include "ddl.h"
#include "drv_irq.h"
#ifdef __cplusplus
extern
"C"
{
#endif
struct
dma_config
{
//M0_DMA_TypeDef *Instance;
rt_uint32_t
channel
;
//en_event_src_t trigger_evt_src;
struct
hc32_irq_config
irq_config
;
};
#ifdef __cplusplus
}
#endif
#endif
/* __DRV_DMA_H__ */
bsp/hc32l136/drivers/drv_gpio.c
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-8-19 pjq first version
* 2021-
0
8-19 pjq first version
*/
#include <rtthread.h>
...
...
@@ -125,75 +125,7 @@ void Gpio_IRQHandler(uint8_t u8Param)
rt_interrupt_leave
();
}
//void PORTA_IRQHandler(void)
//{
// en_gpio_pin_t i;
//
// rt_interrupt_enter();
// for (i=GpioPin0; i<=GpioPin15; i++)
// {
// if(TRUE == Gpio_GetIrqStatus(GpioPortA, i))
// {
// Gpio_ClearIrq(GpioPortA, i);
// pin_irq_handler(GpioPortA, i);
// }
// }
// rt_interrupt_leave();
//}
//void PORTB_IRQHandler(void)
//{
// en_gpio_pin_t i;
//
// rt_interrupt_enter();
// for (i=GpioPin0; i<=GpioPin15; i++)
// {
// if(TRUE == Gpio_GetIrqStatus(GpioPortB, i))
// {
// Gpio_ClearIrq(GpioPortB, i);
// pin_irq_handler(GpioPortB, i);
// }
// }
// rt_interrupt_leave();
//}
//void PORTC_IRQHandler(void)
//{
// en_gpio_pin_t i;
//
// rt_interrupt_enter();
// for (i=GpioPin0; i<=GpioPin15; i++)
// {
// if(TRUE == Gpio_GetIrqStatus(GpioPortC, i))
// {
// Gpio_ClearIrq(GpioPortC, i);
// pin_irq_handler(GpioPortC, i);
// }
// }
// rt_interrupt_leave();
//}
//void PORTD_IRQHandler(void)
//{
// en_gpio_pin_t i;
//
// rt_interrupt_enter();
// for (i=GpioPin0; i<=GpioPin15; i++)
// {
// if(TRUE == Gpio_GetIrqStatus(GpioPortD, i))
// {
// Gpio_ClearIrq(GpioPortD, i);
// pin_irq_handler(GpioPortD, i);
// }
// }
// rt_interrupt_leave();
//}
static
void
hc32_pin_write
(
rt_device_t
dev
,
rt_base_t
pin
,
rt_base_t
value
)
static
void
_pin_write
(
rt_device_t
dev
,
rt_base_t
pin
,
rt_base_t
value
)
{
uint8_t
gpio_port
;
uint16_t
gpio_pin
;
...
...
@@ -213,7 +145,7 @@ static void hc32_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value)
}
}
static
int
hc32
_pin_read
(
rt_device_t
dev
,
rt_base_t
pin
)
static
int
_pin_read
(
rt_device_t
dev
,
rt_base_t
pin
)
{
uint8_t
gpio_port
;
uint16_t
gpio_pin
;
...
...
@@ -236,7 +168,7 @@ static int hc32_pin_read(rt_device_t dev, rt_base_t pin)
return
value
;
}
static
void
hc32
_pin_mode
(
rt_device_t
dev
,
rt_base_t
pin
,
rt_base_t
mode
)
static
void
_pin_mode
(
rt_device_t
dev
,
rt_base_t
pin
,
rt_base_t
mode
)
{
uint8_t
gpio_port
;
uint16_t
gpio_pin
;
...
...
@@ -290,7 +222,7 @@ static void hc32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
Gpio_Init
((
en_gpio_port_t
)
gpio_port
,
(
en_gpio_pin_t
)
gpio_pin
,
&
pstcGpioCfg
);
}
static
rt_err_t
hc32
_pin_attach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
,
static
rt_err_t
_pin_attach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
,
rt_uint32_t
mode
,
void
(
*
hdr
)(
void
*
args
),
void
*
args
)
{
rt_base_t
level
;
...
...
@@ -325,7 +257,7 @@ static rt_err_t hc32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return
RT_EOK
;
}
static
rt_err_t
hc32
_pin_detach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
)
static
rt_err_t
_pin_detach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
)
{
rt_base_t
level
;
rt_int32_t
irqindex
=
-
1
;
...
...
@@ -351,7 +283,7 @@ static rt_err_t hc32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
return
RT_EOK
;
}
static
rt_err_t
hc32
_pin_irq_enable
(
struct
rt_device
*
device
,
rt_base_t
pin
,
rt_uint32_t
enabled
)
static
rt_err_t
_pin_irq_enable
(
struct
rt_device
*
device
,
rt_base_t
pin
,
rt_uint32_t
enabled
)
{
rt_base_t
level
;
en_gpio_port_t
gpio_port
;
...
...
@@ -428,21 +360,21 @@ static rt_err_t hc32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_
return
RT_EOK
;
}
static
const
struct
rt_pin_ops
pin_ops
=
static
const
struct
rt_pin_ops
_
pin_ops
=
{
hc32
_pin_mode
,
hc32
_pin_write
,
hc32
_pin_read
,
hc32
_pin_attach_irq
,
hc32
_pin_detach_irq
,
hc32
_pin_irq_enable
,
_pin_mode
,
_pin_write
,
_pin_read
,
_pin_attach_irq
,
_pin_detach_irq
,
_pin_irq_enable
,
};
int
rt_hw_pin_init
(
void
)
{
Sysctrl_SetPeripheralGate
(
SysctrlPeripheralGpio
,
TRUE
);
return
rt_device_pin_register
(
"pin"
,
&
pin_ops
,
RT_NULL
);
return
rt_device_pin_register
(
"pin"
,
&
_
pin_ops
,
RT_NULL
);
}
INIT_BOARD_EXPORT
(
rt_hw_pin_init
);
...
...
bsp/hc32l136/drivers/drv_gpio.h
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 202
0-10-30 CDT
first version
* 202
1-08-19 pjq
first version
*/
#ifndef __DRV_GPIO_H__
...
...
bsp/hc32l136/drivers/drv_soft_i2c.c
已删除
100644 → 0
浏览文件 @
83636c46
/*
* Copyright (C) 2020, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-10-30 CDT first version
* 2021-01-18 CDT modify i2c gpio init
*/
/*******************************************************************************
* Include files
******************************************************************************/
#include "drv_soft_i2c.h"
#include "board.h"
#if defined RT_USING_I2C
#if !defined(BSP_USING_I2C1) && !defined(BSP_USING_I2C2) && \
!defined(BSP_USING_I2C3) && !defined(BSP_USING_I2C4) && \
!defined(BSP_USING_I2C5) && !defined(BSP_USING_I2C6)
#error "Please define at least one BSP_USING_I2Cx"
#endif
/*******************************************************************************
* Local type definitions ('typedef')
******************************************************************************/
/*******************************************************************************
* Local pre-processor symbols/macros ('#define')
******************************************************************************/
/*******************************************************************************
* Global variable definitions (declared in header file with 'extern')
******************************************************************************/
/*******************************************************************************
* Local function prototypes ('static')
******************************************************************************/
/*******************************************************************************
* Local variable definitions ('static')
******************************************************************************/
static
const
struct
hc32_soft_i2c_config
soft_i2c_config
[]
=
{
#ifdef BSP_USING_I2C1
I2C1_BUS_CONFIG
,
#endif
#ifdef BSP_USING_I2C2
I2C2_BUS_CONFIG
,
#endif
#ifdef BSP_USING_I2C3
I2C3_BUS_CONFIG
,
#endif
#ifdef BSP_USING_I2C4
I2C4_BUS_CONFIG
,
#endif
#ifdef BSP_USING_I2C5
I2C5_BUS_CONFIG
,
#endif
#ifdef BSP_USING_I2C6
I2C6_BUS_CONFIG
,
#endif
};
static
struct
hc32_i2c
i2c_obj
[
sizeof
(
soft_i2c_config
)
/
sizeof
(
soft_i2c_config
[
0
])];
/*******************************************************************************
* Function implementation - global ('extern') and local ('static')
******************************************************************************/
/**
* This function initializes the i2c pin.
*
* @param Hc32 i2c dirver class.
*/
static
void
hc32_i2c_gpio_init
(
struct
hc32_i2c
*
i2c
)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
i2c
->
ops
.
data
;
rt_pin_mode
(
cfg
->
scl_pin
,
PIN_MODE_OUTPUT_OD
);
rt_pin_mode
(
cfg
->
sda_pin
,
PIN_MODE_OUTPUT_OD
);
rt_pin_write
(
cfg
->
scl_pin
,
PIN_HIGH
);
rt_pin_write
(
cfg
->
sda_pin
,
PIN_HIGH
);
}
/**
* This function sets the sda pin.
*
* @param Hc32 config class.
* @param The sda pin state.
*/
static
void
hc32_set_sda
(
void
*
data
,
rt_int32_t
state
)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
if
(
state
)
rt_pin_write
(
cfg
->
sda_pin
,
PIN_HIGH
);
else
rt_pin_write
(
cfg
->
sda_pin
,
PIN_LOW
);
}
/**
* This function sets the scl pin.
*
* @param Hc32 config class.
* @param The scl pin state.
*/
static
void
hc32_set_scl
(
void
*
data
,
rt_int32_t
state
)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
if
(
state
)
rt_pin_write
(
cfg
->
scl_pin
,
PIN_HIGH
);
else
rt_pin_write
(
cfg
->
scl_pin
,
PIN_LOW
);
}
/**
* This function gets the sda pin state.
*
* @param The sda pin state.
*/
static
rt_int32_t
hc32_get_sda
(
void
*
data
)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
return
rt_pin_read
(
cfg
->
sda_pin
);
}
/**
* This function gets the scl pin state.
*
* @param The scl pin state.
*/
static
rt_int32_t
hc32_get_scl
(
void
*
data
)
{
struct
hc32_soft_i2c_config
*
cfg
=
(
struct
hc32_soft_i2c_config
*
)
data
;
return
rt_pin_read
(
cfg
->
scl_pin
);
}
static
void
hc32_udelay
(
rt_uint32_t
us
)
{
rt_hw_us_delay
(
us
);
}
static
const
struct
rt_i2c_bit_ops
hc32_bit_ops
=
{
.
data
=
RT_NULL
,
.
set_sda
=
hc32_set_sda
,
.
set_scl
=
hc32_set_scl
,
.
get_sda
=
hc32_get_sda
,
.
get_scl
=
hc32_get_scl
,
.
udelay
=
hc32_udelay
,
.
delay_us
=
1
,
.
timeout
=
100
};
static
rt_err_t
hc32_i2c_bus_unlock
(
const
struct
hc32_soft_i2c_config
*
cfg
)
{
rt_uint32_t
i
=
0
;
if
(
PIN_LOW
==
rt_pin_read
(
cfg
->
sda_pin
))
{
while
(
i
++
<
9
)
{
rt_pin_write
(
cfg
->
scl_pin
,
PIN_HIGH
);
//HC32_udelay(100);
rt_pin_write
(
cfg
->
scl_pin
,
PIN_LOW
);
//hc32_udelay(100);
}
}
if
(
PIN_LOW
==
rt_pin_read
(
cfg
->
sda_pin
))
return
RT_ERROR
;
return
RT_EOK
;
}
/* I2C initialization function */
int
hc32_hw_i2c_init
(
void
)
{
rt_size_t
obj_num
=
sizeof
(
i2c_obj
)
/
sizeof
(
struct
hc32_i2c
);
rt_err_t
result
;
for
(
int
i
=
0
;
i
<
obj_num
;
i
++
)
{
i2c_obj
[
i
].
ops
=
hc32_bit_ops
;
i2c_obj
[
i
].
ops
.
data
=
(
void
*
)
&
soft_i2c_config
[
i
];
i2c_obj
[
i
].
i2c1_bus
.
priv
=
&
i2c_obj
[
i
].
ops
;
hc32_i2c_gpio_init
(
&
i2c_obj
[
i
]);
result
=
rt_i2c_bit_add_bus
(
&
i2c_obj
[
i
].
i2c1_bus
,
soft_i2c_config
[
i
].
bus_name
);
RT_ASSERT
(
result
==
RT_EOK
);
hc32_i2c_bus_unlock
(
&
soft_i2c_config
[
i
]);
}
return
RT_EOK
;
}
INIT_BOARD_EXPORT
(
hc32_hw_i2c_init
);
#endif
/* RT_USING_I2C */
/*******************************************************************************
* EOF (not truncated)
******************************************************************************/
bsp/hc32l136/drivers/drv_soft_i2c.h
已删除
100644 → 0
浏览文件 @
83636c46
/*
* Copyright (C) 2020, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-10-30 CDT first version
*/
#ifndef __DRV_I2C_H__
#define __DRV_I2C_H__
/*******************************************************************************
* Include files
******************************************************************************/
#include <rtdevice.h>
#include "hc32_ddl.h"
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern
"C"
{
#endif
/*******************************************************************************
* Global type definitions ('typedef')
******************************************************************************/
struct
hc32_soft_i2c_config
{
rt_uint16_t
scl_pin
;
rt_uint16_t
sda_pin
;
const
char
*
bus_name
;
};
#ifdef BSP_USING_I2C1
#define I2C1_BUS_CONFIG \
{ \
.scl_pin = BSP_I2C1_SCL_PIN, \
.sda_pin = BSP_I2C1_SDA_PIN, \
.bus_name = "i2c1", \
}
#endif
#ifdef BSP_USING_I2C2
#define I2C2_BUS_CONFIG \
{ \
.scl = BSP_I2C2_SCL_PIN, \
.sda = BSP_I2C2_SDA_PIN, \
.bus_name = "i2c2", \
}
#endif
#ifdef BSP_USING_I2C3
#define I2C3_BUS_CONFIG \
{ \
.scl = BSP_I2C3_SCL_PIN, \
.sda = BSP_I2C3_SDA_PIN, \
.bus_name = "i2c3", \
}
#endif
#ifdef BSP_USING_I2C4
#define I2C4_BUS_CONFIG \
{ \
.scl = BSP_I2C4_SCL_PIN, \
.sda = BSP_I2C4_SDA_PIN, \
.bus_name = "i2c4", \
}
#endif
#ifdef BSP_USING_I2C5
#define I2C5_BUS_CONFIG \
{ \
.scl = BSP_I2C5_SCL_PIN, \
.sda = BSP_I2C5_SDA_PIN, \
.bus_name = "i2c5", \
}
#endif
#ifdef BSP_USING_I2C6
#define I2C6_BUS_CONFIG \
{ \
.scl = BSP_I2C6_SCL_PIN, \
.sda = BSP_I2C6_SDA_PIN, \
.bus_name = "i2c6", \
}
#endif
/**
*******************************************************************************
** \brief Open parameters.
*******************************************************************************
*/
struct
hc32_i2c_config
{
rt_uint8_t
scl
;
rt_uint8_t
sda
;
const
char
*
bus_name
;
};
struct
hc32_i2c
{
struct
rt_i2c_bit_ops
ops
;
struct
rt_i2c_bus_device
i2c1_bus
;
};
typedef
struct
hc32_i2c_instance
{
rt_uint32_t
id
;
void
*
handle
;
stc_i2c_init_t
init
;
}
hc32_i2c_instance_t
;
int
hc32_hw_i2c_init
(
void
);
#ifdef __cplusplus
}
#endif
#endif
/* __DRV_I2C_H__ */
/*******************************************************************************
* EOF (not truncated)
******************************************************************************/
bsp/hc32l136/drivers/drv_usart.c
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 202
0-10-30 CDT
first version
* 202
1-08-19 pjq
first version
*/
/*******************************************************************************
...
...
@@ -30,9 +30,7 @@
/* HC32 config Rx timeout */
struct
hc32_uart_rxto
{
//M4_TMR0_TypeDef *TMR0_Instance;
rt_uint32_t
channel
;
rt_size_t
timeout_bits
;
};
...
...
@@ -41,7 +39,6 @@ struct uart_index
{
rt_uint8_t
index
;
rt_uint8_t
idx
;
//M0P_UART_TypeDef *Instance;
};
/* HC32 UART irq handler */
...
...
@@ -52,7 +49,6 @@ struct uart_irq_handler
void
(
*
rx_irq_handler
)(
void
);
void
(
*
cts_irq_handler
)(
void
);
void
(
*
pei_irq_handler
)(
void
);
// void (*dma_rx_irq_handler)(void);
};
/*******************************************************************************
...
...
@@ -216,8 +212,8 @@ static rt_err_t hc32_configure(struct rt_serial_device *serial,
stcConfig
.
pstcIrqCb
=
&
stcUartIrqCb
;
stcConfig
.
bTouchNvic
=
TRUE
;
stcConfig
.
enRunMode
=
UartMode3
;
//ģʽ3
stcMulti
.
enMulti_mode
=
UartNormal
;
//ģʽ
stcConfig
.
enRunMode
=
UartMode3
;
stcMulti
.
enMulti_mode
=
UartNormal
;
if
(
BIT_ORDER_LSB
==
cfg
->
bit_order
)
{
...
...
@@ -589,7 +585,6 @@ int hc32_hw_uart_init(void)
hc32_uart_get_dma_config
();
Sysctrl_SetPeripheralGate
(
SysctrlPeripheralGpio
,
TRUE
);
//Sysctrl_SetPeripheralGate(SysctrlPeripheralDma,TRUE);
#ifdef BSP_USING_UART0
Sysctrl_SetPeripheralGate
(
SysctrlPeripheralUart0
,
TRUE
);
#endif
...
...
bsp/hc32l136/drivers/drv_usart.h
浏览文件 @
d0c0e4e6
/*
* Copyright (C) 202
0
, Huada Semiconductor Co., Ltd.
* Copyright (C) 202
1
, Huada Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 202
0-10-30 CDT
first version
* 202
1-08-19 pjq
first version
*/
...
...
bsp/hc32l136/project.uvoptx
浏览文件 @
d0c0e4e6
...
...
@@ -246,24 +246,24 @@
<File>
<GroupNumber>
2
</GroupNumber>
<FileNumber>
5
</FileNumber>
<FileType>
2
</FileType>
<FileType>
1
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\libcpu\arm\cortex-m0\c
ontext_rvds.S
</PathWithFileName>
<FilenameWithoutPath>
c
ontext_rvds.S
</FilenameWithoutPath>
<PathWithFileName>
..\..\libcpu\arm\cortex-m0\c
puport.c
</PathWithFileName>
<FilenameWithoutPath>
c
puport.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
<File>
<GroupNumber>
2
</GroupNumber>
<FileNumber>
6
</FileNumber>
<FileType>
1
</FileType>
<FileType>
2
</FileType>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\libcpu\arm\cortex-m0\c
puport.c
</PathWithFileName>
<FilenameWithoutPath>
c
puport.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\libcpu\arm\cortex-m0\c
ontext_rvds.S
</PathWithFileName>
<FilenameWithoutPath>
c
ontext_rvds.S
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -395,7 +395,7 @@
<GroupNumber>
4
</GroupNumber>
<FileNumber>
16
</FileNumber>
<FileType>
1
</FileType>
<tvExp>
1
</tvExp>
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
board\board.c
</PathWithFileName>
...
...
@@ -782,8 +782,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
ipc
.c
</PathWithFileName>
<FilenameWithoutPath>
ipc
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
clock
.c
</PathWithFileName>
<FilenameWithoutPath>
clock
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -794,8 +794,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
thread
.c
</PathWithFileName>
<FilenameWithoutPath>
thread
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
ipc
.c
</PathWithFileName>
<FilenameWithoutPath>
ipc
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -806,8 +806,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
clock
.c
</PathWithFileName>
<FilenameWithoutPath>
clock
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
mempool
.c
</PathWithFileName>
<FilenameWithoutPath>
mempool
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -818,8 +818,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
mempool
.c
</PathWithFileName>
<FilenameWithoutPath>
mempool
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
scheduler
.c
</PathWithFileName>
<FilenameWithoutPath>
scheduler
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -830,8 +830,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
timer
.c
</PathWithFileName>
<FilenameWithoutPath>
timer
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
idle
.c
</PathWithFileName>
<FilenameWithoutPath>
idle
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -842,8 +842,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
scheduler
.c
</PathWithFileName>
<FilenameWithoutPath>
scheduler
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
kservice
.c
</PathWithFileName>
<FilenameWithoutPath>
kservice
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -854,8 +854,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\i
dle
.c
</PathWithFileName>
<FilenameWithoutPath>
i
dle
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\i
rq
.c
</PathWithFileName>
<FilenameWithoutPath>
i
rq
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -866,8 +866,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
kservice
.c
</PathWithFileName>
<FilenameWithoutPath>
kservice
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
timer
.c
</PathWithFileName>
<FilenameWithoutPath>
timer
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -890,8 +890,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
irq
.c
</PathWithFileName>
<FilenameWithoutPath>
irq
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
object
.c
</PathWithFileName>
<FilenameWithoutPath>
object
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -902,8 +902,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
object
.c
</PathWithFileName>
<FilenameWithoutPath>
object
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
device
.c
</PathWithFileName>
<FilenameWithoutPath>
device
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
@@ -914,8 +914,8 @@
<tvExp>
0
</tvExp>
<tvExpOptDlg>
0
</tvExpOptDlg>
<bDave2>
0
</bDave2>
<PathWithFileName>
..\..\src\
device
.c
</PathWithFileName>
<FilenameWithoutPath>
device
.c
</FilenameWithoutPath>
<PathWithFileName>
..\..\src\
thread
.c
</PathWithFileName>
<FilenameWithoutPath>
thread
.c
</FilenameWithoutPath>
<RteFlg>
0
</RteFlg>
<bShared>
0
</bShared>
</File>
...
...
bsp/hc32l136/project.uvprojx
浏览文件 @
d0c0e4e6
...
...
@@ -337,9 +337,9 @@
<v6Rtti>
0
</v6Rtti>
<VariousControls>
<MiscControls>
--diag_suppress=186,66
</MiscControls>
<Define>
USE_DDL_DRIVER, __DEBUG, __RTTHREAD__, HC32L136
</Define>
<Define>
USE_DDL_DRIVER, __DEBUG, __RTTHREAD__, HC32L136
, __CLK_TCK=RT_TICK_PER_SECOND
</Define>
<Undefine></Undefine>
<IncludePath>
applications;.;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m0;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;board;drivers;..\..\components\finsh;Libraries\CMSIS\Include;Libraries\CMSIS\Device\HDSC\HC32L136\Include;Libraries\HC32L136_StdPeriph_Driver\inc;.;..\..\include
</IncludePath>
<IncludePath>
applications;.;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m0;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;board;drivers;..\..\components\finsh;Libraries\CMSIS\Include;Libraries\CMSIS\Device\HDSC\HC32L136\Include;Libraries\HC32L136_StdPeriph_Driver\inc;.;..\..\include
;..\..\components\libc\compilers\common;..\..\components\libc\compilers\common\none-gcc;..\..\examples\utest\testcases\kernel
</IncludePath>
</VariousControls>
</Cads>
<Aads>
...
...
@@ -408,16 +408,16 @@
<FileType>
1
</FileType>
<FilePath>
..\..\libcpu\arm\common\showmem.c
</FilePath>
</File>
<File>
<FileName>
context_rvds.S
</FileName>
<FileType>
2
</FileType>
<FilePath>
..\..\libcpu\arm\cortex-m0\context_rvds.S
</FilePath>
</File>
<File>
<FileName>
cpuport.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\libcpu\arm\cortex-m0\cpuport.c
</FilePath>
</File>
<File>
<FileName>
context_rvds.S
</FileName>
<FileType>
2
</FileType>
<FilePath>
..\..\libcpu\arm\cortex-m0\context_rvds.S
</FilePath>
</File>
</Files>
</Group>
<Group>
...
...
@@ -638,30 +638,20 @@
<FileType>
1
</FileType>
<FilePath>
..\..\src\mem.c
</FilePath>
</File>
<File>
<FileName>
ipc.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\ipc.c
</FilePath>
</File>
<File>
<FileName>
thread.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\thread.c
</FilePath>
</File>
<File>
<FileName>
clock.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\clock.c
</FilePath>
</File>
<File>
<FileName>
mempool
.c
</FileName>
<FileName>
ipc
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\
mempool
.c
</FilePath>
<FilePath>
..\..\src\
ipc
.c
</FilePath>
</File>
<File>
<FileName>
timer
.c
</FileName>
<FileName>
mempool
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\
timer
.c
</FilePath>
<FilePath>
..\..\src\
mempool
.c
</FilePath>
</File>
<File>
<FileName>
scheduler.c
</FileName>
...
...
@@ -679,14 +669,19 @@
<FilePath>
..\..\src\kservice.c
</FilePath>
</File>
<File>
<FileName>
components
.c
</FileName>
<FileName>
irq
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\
components
.c
</FilePath>
<FilePath>
..\..\src\
irq
.c
</FilePath>
</File>
<File>
<FileName>
irq
.c
</FileName>
<FileName>
timer
.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\irq.c
</FilePath>
<FilePath>
..\..\src\timer.c
</FilePath>
</File>
<File>
<FileName>
components.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\components.c
</FilePath>
</File>
<File>
<FileName>
object.c
</FileName>
...
...
@@ -698,6 +693,11 @@
<FileType>
1
</FileType>
<FilePath>
..\..\src\device.c
</FilePath>
</File>
<File>
<FileName>
thread.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\src\thread.c
</FilePath>
</File>
</Files>
</Group>
</Groups>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录