Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
0192ae21
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
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看板
提交
0192ae21
编写于
3月 17, 2018
作者:
南工孙冬梅
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][ls1c]change RT_USING_UART to RT_USING_SERIAL;remove some device init
上级
05aea0f8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
126 deletion
+7
-126
bsp/ls1cdev/drivers/board.c
bsp/ls1cdev/drivers/board.c
+7
-126
未找到文件。
bsp/ls1cdev/drivers/board.c
浏览文件 @
0192ae21
...
...
@@ -15,16 +15,11 @@
*/
#include <rtthread.h>
#include <drivers/spi.h>
#include <rthw.h>
#include "board.h"
#include "uart.h"
#include "ls1c.h"
#include "ls1c_pin.h"
#include "ls1c_spi.h"
#include "ls1c_spi.h"
#include "drv_spi.h"
/**
* @addtogroup Loongson LS1B
...
...
@@ -86,7 +81,7 @@ void rt_hw_fpu_init(void)
*/
void
rt_hw_board_init
(
void
)
{
#ifdef RT_USING_
UART
#ifdef RT_USING_
SERIAL
/* init hardware UART device */
rt_hw_uart_init
();
#endif
...
...
@@ -95,134 +90,20 @@ void rt_hw_board_init(void)
/* set console device */
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#ifdef RT_USING_CAN
/* init hardware CAN device */
ls1c_bxcan_init
();
#endif
#ifdef RT_USING_I2C
#ifdef RT_USING_I2C0
/*
pin_set_purpose(2, PIN_PURPOSE_OTHER);
pin_set_purpose(3, PIN_PURPOSE_OTHER);
pin_set_remap(2, PIN_REMAP_SECOND);
pin_set_remap(3, PIN_REMAP_SECOND);
*/
#endif
#ifdef RT_USING_I2C1
pin_set_purpose
(
2
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
3
,
PIN_PURPOSE_OTHER
);
pin_set_remap
(
2
,
PIN_REMAP_SECOND
);
pin_set_remap
(
3
,
PIN_REMAP_SECOND
);
#endif
#ifdef RT_USING_I2C2
pin_set_purpose
(
51
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
50
,
PIN_PURPOSE_OTHER
);
pin_set_remap
(
51
,
PIN_REMAP_FOURTH
);
pin_set_remap
(
50
,
PIN_REMAP_FOURTH
);
#endif
rt_i2c_init
();
#endif
#ifdef RT_USING_SPI
#ifdef RT_USING_SPI0
pin_set_purpose
(
78
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
79
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
80
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
83
,
PIN_PURPOSE_OTHER
);
//cs2 - SD card
pin_set_purpose
(
82
,
PIN_PURPOSE_OTHER
);
//cs1
pin_set_remap
(
78
,
PIN_REMAP_FOURTH
);
pin_set_remap
(
79
,
PIN_REMAP_FOURTH
);
pin_set_remap
(
80
,
PIN_REMAP_FOURTH
);
pin_set_remap
(
83
,
PIN_REMAP_FOURTH
);
//cs2 - SD card
pin_set_remap
(
82
,
PIN_REMAP_FOURTH
);
//cs1
ls1c_spi_bus_register
(
LS1C_SPI_0
,
"spi0"
);
#endif
#ifdef RT_USING_SPI1
pin_set_purpose
(
46
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
47
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
48
,
PIN_PURPOSE_OTHER
);
pin_set_purpose
(
49
,
PIN_PURPOSE_OTHER
);
//CS0 - touch screen
pin_set_remap
(
46
,
PIN_REMAP_THIRD
);
pin_set_remap
(
47
,
PIN_REMAP_THIRD
);
pin_set_remap
(
48
,
PIN_REMAP_THIRD
);
pin_set_remap
(
49
,
PIN_REMAP_THIRD
);
//CS0 - touch screen
ls1c_spi_bus_register
(
LS1C_SPI_1
,
"spi1"
);
#endif
#ifdef RT_USING_SPI0
/* attach cs */
{
static
struct
rt_spi_device
spi_device1
;
static
struct
rt_spi_device
spi_device2
;
static
struct
ls1c_spi_cs
spi_cs1
;
static
struct
ls1c_spi_cs
spi_cs2
;
/* spi02: CS2 SD Card*/
spi_cs2
.
cs
=
LS1C_SPI_CS_2
;
rt_spi_bus_attach_device
(
&
spi_device2
,
"spi02"
,
"spi0"
,
(
void
*
)
&
spi_cs2
);
spi_cs1
.
cs
=
LS1C_SPI_CS_1
;
rt_spi_bus_attach_device
(
&
spi_device1
,
"spi01"
,
"spi0"
,
(
void
*
)
&
spi_cs1
);
msd_init
(
"sd0"
,
"spi02"
);
}
#endif
#ifdef RT_USING_SPI1
{
static
struct
rt_spi_device
spi_device
;
static
struct
ls1c_spi_cs
spi_cs
;
/* spi10: CS0 Touch*/
spi_cs
.
cs
=
LS1C_SPI_CS_0
;
rt_spi_bus_attach_device
(
&
spi_device
,
"spi10"
,
"spi1"
,
(
void
*
)
&
spi_cs
);
}
#endif
#endif
/* init operating system timer */
rt_hw_timer_init
();
/* init operating system timer */
rt_hw_timer_init
();
#ifdef RT_USING_FPU
/* init hardware fpu */
rt_hw_fpu_init
();
#endif
rt_kprintf
(
"current sr: 0x%08x
\n
"
,
read_c0_status
());
}
#ifdef RT_USING_RTGUI
#include <rtgui/driver.h>
#include "display_controller.h"
/* initialize for gui driver */
int
rtgui_lcd_init
(
void
)
{
rt_device_t
dc
;
rt_kprintf
(
"DC initied
\n
"
);
pin_set_purpose
(
76
,
PIN_PURPOSE_OTHER
);
pin_set_remap
(
76
,
PIN_REMAP_DEFAULT
);
/* init Display Controller */
rt_hw_dc_init
();
/* find Display Controller device */
dc
=
rt_device_find
(
"dc"
);
/* set Display Controller device as rtgui graphic driver */
rtgui_graphic_set_device
(
dc
);
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init
();
#endif
return
0
;
rt_kprintf
(
"current sr: 0x%08x
\n
"
,
read_c0_status
());
}
INIT_DEVICE_EXPORT
(
rtgui_lcd_init
);
#endif
#define __raw_out_put(unr) \
while (*ptr) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录