Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
卖小麦←_←
rt-thread
提交
c20c2b6d
R
rt-thread
项目概览
卖小麦←_←
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c20c2b6d
编写于
3月 12, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[w60x][drivers] auto formatted
上级
849c99d2
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
85 addition
and
85 deletion
+85
-85
bsp/w60x/drivers/board.c
bsp/w60x/drivers/board.c
+8
-8
bsp/w60x/drivers/drv_crypto.c
bsp/w60x/drivers/drv_crypto.c
+43
-43
bsp/w60x/drivers/drv_rtc.c
bsp/w60x/drivers/drv_rtc.c
+1
-1
bsp/w60x/drivers/drv_soft_i2c.c
bsp/w60x/drivers/drv_soft_i2c.c
+3
-3
bsp/w60x/drivers/drv_soft_i2c.h
bsp/w60x/drivers/drv_soft_i2c.h
+1
-1
bsp/w60x/drivers/drv_standby.c
bsp/w60x/drivers/drv_standby.c
+2
-2
bsp/w60x/drivers/drv_uart.c
bsp/w60x/drivers/drv_uart.c
+1
-1
bsp/w60x/drivers/pin_config.h
bsp/w60x/drivers/pin_config.h
+1
-1
bsp/w60x/oneshot/oneshot.c
bsp/w60x/oneshot/oneshot.c
+21
-21
bsp/w60x/oneshot/oneshot.h
bsp/w60x/oneshot/oneshot.h
+3
-3
bsp/w60x/oneshot/oneshot_demo.c
bsp/w60x/oneshot/oneshot_demo.c
+1
-1
未找到文件。
bsp/w60x/drivers/board.c
浏览文件 @
c20c2b6d
...
...
@@ -98,14 +98,14 @@ void disp_version_info(void)
void
wm_gpio_config
(
void
)
{
/* must call first */
wm_gpio_af_disable
();
/*MASTER SPI configuratioin*/
wm_spi_cs_config
(
WM_IO_PA_02
);
wm_spi_ck_config
(
WM_IO_PA_11
);
wm_spi_di_config
(
WM_IO_PA_03
);
wm_spi_do_config
(
WM_IO_PA_09
);
/* must call first */
wm_gpio_af_disable
();
/*MASTER SPI configuratioin*/
wm_spi_cs_config
(
WM_IO_PA_02
);
wm_spi_ck_config
(
WM_IO_PA_11
);
wm_spi_di_config
(
WM_IO_PA_03
);
wm_spi_do_config
(
WM_IO_PA_09
);
}
static
int
wm_infsl_init
(
void
)
...
...
bsp/w60x/drivers/drv_crypto.c
浏览文件 @
c20c2b6d
...
...
@@ -465,25 +465,25 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
const
struct
hw_bignum_mpi
*
b
,
const
struct
hw_bignum_mpi
*
c
)
{
pstm_int
pa
,
pb
,
pm
,
pres
;
pstm_int
pa
,
pb
,
pm
,
pres
;
u32
*
buff_a
=
NULL
;
u32
*
buff_b
=
NULL
;
u32
*
buff_m
=
NULL
;
int
err
=
-
1
;
u32
*
buff_b
=
NULL
;
u32
*
buff_m
=
NULL
;
int
err
=
-
1
;
void
*
buff
;
int
buff_len
;
pstm_init
(
NULL
,
&
pres
);
buff_a
=
tls_mem_alloc
(
a
->
total
);
if
(
buff_a
==
NULL
)
goto
out
;
buff_b
=
tls_mem_alloc
(
b
->
total
);
if
(
buff_b
==
NULL
)
goto
out
;
buff_m
=
tls_mem_alloc
(
c
->
total
);
if
(
buff_m
==
NULL
)
goto
out
;
if
(
buff_a
==
NULL
)
goto
out
;
buff_b
=
tls_mem_alloc
(
b
->
total
);
if
(
buff_b
==
NULL
)
goto
out
;
buff_m
=
tls_mem_alloc
(
c
->
total
);
if
(
buff_m
==
NULL
)
goto
out
;
memset
(
buff_a
,
0
,
a
->
total
);
memset
(
buff_b
,
0
,
b
->
total
);
...
...
@@ -494,29 +494,29 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
memcpy
(
buff_m
,
c
->
p
,
c
->
total
);
pstm_reverse
((
unsigned
char
*
)
buff_a
,
a
->
total
);
pstm_reverse
((
unsigned
char
*
)
buff_b
,
b
->
total
);
pstm_reverse
((
unsigned
char
*
)
buff_m
,
c
->
total
);
pstm_reverse
((
unsigned
char
*
)
buff_b
,
b
->
total
);
pstm_reverse
((
unsigned
char
*
)
buff_m
,
c
->
total
);
// *((volatile unsigned int *)0x40000710) = *((volatile unsigned int *)0x40000710) | (0x1 << 28);
if
((
err
=
pstm_init_for_read_unsigned_bin
(
NULL
,
&
pa
,
a
->
total
))
!=
PS_SUCCESS
){
goto
out
;
}
if
((
err
=
pstm_read_unsigned_bin
(
&
pa
,
(
unsigned
char
*
)
buff_a
,
a
->
total
))
!=
PS_SUCCESS
)
{
goto
out
;
}
if
((
err
=
pstm_init_for_read_unsigned_bin
(
NULL
,
&
pb
,
b
->
total
))
!=
PS_SUCCESS
){
goto
out
;
}
if
((
err
=
pstm_read_unsigned_bin
(
&
pb
,
(
unsigned
char
*
)
buff_b
,
b
->
total
))
!=
PS_SUCCESS
)
{
goto
out
;
}
if
((
err
=
pstm_init_for_read_unsigned_bin
(
NULL
,
&
pm
,
c
->
total
))
!=
PS_SUCCESS
){
goto
out
;
}
if
((
err
=
pstm_read_unsigned_bin
(
&
pm
,
(
unsigned
char
*
)
buff_m
,
c
->
total
))
!=
PS_SUCCESS
)
{
goto
out
;
}
if
((
err
=
pstm_init_for_read_unsigned_bin
(
NULL
,
&
pa
,
a
->
total
))
!=
PS_SUCCESS
){
goto
out
;
}
if
((
err
=
pstm_read_unsigned_bin
(
&
pa
,
(
unsigned
char
*
)
buff_a
,
a
->
total
))
!=
PS_SUCCESS
)
{
goto
out
;
}
if
((
err
=
pstm_init_for_read_unsigned_bin
(
NULL
,
&
pb
,
b
->
total
))
!=
PS_SUCCESS
){
goto
out
;
}
if
((
err
=
pstm_read_unsigned_bin
(
&
pb
,
(
unsigned
char
*
)
buff_b
,
b
->
total
))
!=
PS_SUCCESS
)
{
goto
out
;
}
if
((
err
=
pstm_init_for_read_unsigned_bin
(
NULL
,
&
pm
,
c
->
total
))
!=
PS_SUCCESS
){
goto
out
;
}
if
((
err
=
pstm_read_unsigned_bin
(
&
pm
,
(
unsigned
char
*
)
buff_m
,
c
->
total
))
!=
PS_SUCCESS
)
{
goto
out
;
}
tls_crypto_exptmod
(
&
pa
,
&
pb
,
&
pm
,
&
pres
);
buff_len
=
pstm_unsigned_bin_size
(
&
pres
);
...
...
@@ -528,16 +528,16 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
out:
if
(
buff_a
)
tls_mem_free
(
buff_a
);
if
(
buff_b
)
tls_mem_free
(
buff_b
);
if
(
buff_m
)
tls_mem_free
(
buff_m
);
tls_mem_free
(
buff_a
);
if
(
buff_b
)
tls_mem_free
(
buff_b
);
if
(
buff_m
)
tls_mem_free
(
buff_m
);
pstm_clear
(
&
pa
);
pstm_clear
(
&
pb
);
pstm_clear
(
&
pm
);
pstm_clear
(
&
pres
);
pstm_clear
(
&
pa
);
pstm_clear
(
&
pb
);
pstm_clear
(
&
pm
);
pstm_clear
(
&
pres
);
if
(
a
->
sign
<
0
)
{
...
...
@@ -583,7 +583,7 @@ static const struct hwcrypto_crc_ops crc_ops =
.
update
=
_crc_update
,
};
static
const
struct
hwcrypto_bignum_ops
bignum_ops
=
static
const
struct
hwcrypto_bignum_ops
bignum_ops
=
{
.
add
=
RT_NULL
,
.
sub
=
RT_NULL
,
...
...
@@ -722,7 +722,7 @@ int wm_hw_crypto_device_init(void)
_crypto_dev
.
dev
.
ops
=
&
_ops
;
_crypto_dev
.
dev
.
id
=
0
;
rt_memcpy
(
&
_crypto_dev
.
dev
.
id
,
wpa_supplicant_get_mac
(),
rt_memcpy
(
&
_crypto_dev
.
dev
.
id
,
wpa_supplicant_get_mac
(),
sizeof
(
_crypto_dev
.
dev
.
id
)
>
6
?
6
:
sizeof
(
_crypto_dev
.
dev
.
id
));
_crypto_dev
.
dev
.
user_data
=
&
_crypto_dev
;
...
...
bsp/w60x/drivers/drv_rtc.c
浏览文件 @
c20c2b6d
...
...
@@ -172,7 +172,7 @@ static rt_size_t wm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer,
}
#ifdef RT_USING_DEVICE_OPS
const
static
struct
rt_device_ops
_ops
=
const
static
struct
rt_device_ops
_ops
=
{
.
init
=
wm_rtc_init
,
.
open
=
wm_rtc_open
,
...
...
bsp/w60x/drivers/drv_soft_i2c.c
浏览文件 @
c20c2b6d
/*
* Copyright (c) 2006-20
19
, RT-Thread Development Team
* Copyright (c) 2006-20
21
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
@@ -198,8 +198,8 @@ int rt_soft_i2c_init(void)
w60x_i2c_bus_unlock
(
&
soft_i2c_config
[
i
]);
LOG_D
(
"software simulation %s init done, pin scl: %d, pin sda %d"
,
soft_i2c_config
[
i
].
bus_name
,
soft_i2c_config
[
i
].
scl
,
soft_i2c_config
[
i
].
bus_name
,
soft_i2c_config
[
i
].
scl
,
soft_i2c_config
[
i
].
sda
);
}
...
...
bsp/w60x/drivers/drv_soft_i2c.h
浏览文件 @
c20c2b6d
/*
* Copyright (c) 2006-20
19
, RT-Thread Development Team
* Copyright (c) 2006-20
21
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
bsp/w60x/drivers/drv_standby.c
浏览文件 @
c20c2b6d
...
...
@@ -33,7 +33,7 @@ extern void standby_idr(void);
#if (1 == GCC_COMPILE)
void
wm_pm_standby
(
void
)
{
__asm
volatile
(
__asm
volatile
(
" cpsid i
\n
"
/* disable irq*/
" dsb
\n
"
" ldr r0, =0X499
\n
"
...
...
@@ -76,7 +76,7 @@ void sys_start_standby(int ms)
{
return
;
}
tls_irq_enable
(
PMU_GPIO_WAKEUP_INT
);
//Open interrupt by default to clear the interrupt flag for IO wake-up
tls_irq_enable
(
PMU_GPIO_WAKEUP_INT
);
//Open interrupt by default to clear the interrupt flag for IO wake-up
val
=
tls_reg_read32
(
HR_PMU_PS_CR
);
val
|=
0x01
;
tls_reg_write32
(
HR_PMU_PS_CR
,
val
);
...
...
bsp/w60x/drivers/drv_uart.c
浏览文件 @
c20c2b6d
...
...
@@ -208,7 +208,7 @@ static int wm_uart_flow_ctrl_set(TLS_UART_REGS_T *UARTx, TLS_UART_FLOW_CTRL_MODE
case
TLS_UART_FLOW_CTRL_HARDWARE
:
UARTx
->
UR_FC
=
(
1UL
<<
0
)
|
(
6UL
<<
2
);
break
;
break
;
default:
break
;
...
...
bsp/w60x/drivers/pin_config.h
浏览文件 @
c20c2b6d
/*
* Copyright (c) 2006-20
19
, RT-Thread Development Team
* Copyright (c) 2006-20
21
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
bsp/w60x/oneshot/oneshot.c
浏览文件 @
c20c2b6d
/*
* Copyright (c) 2006-20
18
, RT-Thread Development Team
* Copyright (c) 2006-20
21
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
@@ -16,37 +16,37 @@
/* start oneshot */
int
wm_oneshot_start
(
WM_ONESHOT_MODE
mode
,
wm_oneshot_callback
callback
)
{
tls_wifi_oneshot_callback_register
(
callback
);
if
(
mode
==
WM_UDP
)
{
tls_wifi_set_oneshot_config_mode
(
0
);
}
tls_wifi_oneshot_callback_register
(
callback
);
if
(
mode
==
WM_UDP
)
{
tls_wifi_set_oneshot_config_mode
(
0
);
}
else
if
(
mode
==
WM_APSOCKET
)
{
tls_wifi_set_oneshot_config_mode
(
1
);
}
else
if
(
mode
==
WM_APWEB
)
{
tls_wifi_set_oneshot_config_mode
(
2
);
}
else
{
return
-
1
;
}
tls_wifi_set_oneshot_flag
(
1
);
return
0
;
}
else
if
(
mode
==
WM_APWEB
)
{
tls_wifi_set_oneshot_config_mode
(
2
);
}
else
{
return
-
1
;
}
tls_wifi_set_oneshot_flag
(
1
);
return
0
;
}
/* stop oneshot */
int
wm_oneshot_stop
(
void
)
{
tls_wifi_oneshot_callback_delete
();
tls_wifi_set_oneshot_flag
(
0
);
return
0
;
tls_wifi_oneshot_callback_delete
();
tls_wifi_set_oneshot_flag
(
0
);
return
0
;
}
/* get status */
int
wm_oneshot_get
(
void
)
{
return
tls_wifi_get_oneshot_flag
();
return
tls_wifi_get_oneshot_flag
();
}
bsp/w60x/oneshot/oneshot.h
浏览文件 @
c20c2b6d
/*
* Copyright (c) 2006-20
18
, RT-Thread Development Team
* Copyright (c) 2006-20
21
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
@@ -12,9 +12,9 @@
#define DRV_ONESHOT_H__
typedef
enum
{
WM_UDP
,
WM_UDP
,
WM_APSOCKET
,
WM_APWEB
WM_APWEB
}
WM_ONESHOT_MODE
;
...
...
bsp/w60x/oneshot/oneshot_demo.c
浏览文件 @
c20c2b6d
/*
* Copyright (c) 2006-20
18
, RT-Thread Development Team
* Copyright (c) 2006-20
21
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录