Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
0051092c
R
rt-thread
项目概览
人间散章
/
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,体验更适合开发者的 AI 搜索 >>
提交
0051092c
编写于
9月 27, 2020
作者:
C
chenyingchun0312
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync nrf52840 some config files to nrf52832
上级
e3d1ed45
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
80 deletion
+57
-80
bsp/nrf5x/nrf52832/board/Kconfig
bsp/nrf5x/nrf52832/board/Kconfig
+47
-31
bsp/nrf5x/nrf52832/board/board.c
bsp/nrf5x/nrf52832/board/board.c
+7
-46
bsp/nrf5x/nrf52832/board/sdk_config.h
bsp/nrf5x/nrf52832/board/sdk_config.h
+3
-3
未找到文件。
bsp/nrf5x/nrf52832/board/Kconfig
浏览文件 @
0051092c
...
...
@@ -6,6 +6,16 @@ config SOC_NRF52832
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y
config NRFX_CLOCK_ENABLED
int
default 1
config NRFX_CLOCK_DEFAULT_CONFIG_IRQ_PRIORITY
int
default 7
config NRFX_CLOCK_CONFIG_LF_SRC
int
default 1
config SOC_NORDIC
bool
...
...
@@ -26,6 +36,11 @@ menu "On-chip Peripheral Drivers"
bool "Enable GPIO"
select RT_USING_PIN
default y
if BSP_USING_GPIO
config NRFX_GPIOTE_ENABLED
int
default 1
endif
config BSP_USING_SAADC
bool "Enable SAADC"
select RT_USING_ADC
...
...
@@ -140,47 +155,25 @@ menu "On-chip Peripheral Drivers"
default 16
endif
endif
menuconfig BSP_USING_SOFTDEVICE
bool "Enable NRF SOFTDEVICE"
select PKG_USING_NRF5X_SDK
select NRFX_CLOCK_ENABLED
default n
if BSP_USING_SOFTDEVICE
config NRFX_CLOCK_ENABLED
int
default 1
config NRFX_CLOCK_DEFAULT_CONFIG_IRQ_PRIORITY
int
default 7
config NRFX_RTC_ENABLED
int
default 1
config NRFX_RTC1_ENABLED
int
default 1
config NRF_CLOCK_ENABLED
int
default 1
config NRF_SDH_BLE_ENABLED
int
default 1
config NRF_SDH_ENABLED
int
default 1
config NRF_SDH_SOC_ENABLED
int
default 1
endif
menuconfig BSP_USING_UART
bool "Enable UART"
default y
select RT_USING_SERIAL
if BSP_USING_UART
config NRFX_UART_ENABLED
int
default 1
config BSP_USING_UART0
bool "Enable UART0"
default y
if BSP_USING_UART0
config NRFX_UART0_ENABLED
int
default 1
config BSP_UART0_RX_PIN
int "uart0 rx pin number"
range 0 31
...
...
@@ -201,6 +194,9 @@ endif
default y
if BSP_USING_SPI
config NRFX_SPI_ENABLED
int
default 1
config BSP_USING_SPI0
bool "Enable SPI0 bus"
default y
...
...
@@ -348,4 +344,24 @@ endif
endif
endmenu
choice
prompt "BLE STACK"
default BLE_STACK_USING_NULL
help
Select the ble stack
config BLE_STACK_USING_NULL
bool "not use the ble stack"
config BSP_USING_SOFTDEVICE
select PKG_USING_NRF5X_SDK
bool "Nordic softdevice(perpheral)"
config BSP_USING_NIMBLE
select PKG_USING_NIMBLE
select PKG_NIMBLE_BSP_NRF52840
bool "use nimble stack(iot)"
endchoice
endmenu
bsp/nrf5x/nrf52832/board/board.c
浏览文件 @
0051092c
...
...
@@ -14,25 +14,8 @@
#include "board.h"
#include "drv_uart.h"
#ifdef BSP_USING_SOFTDEVICE
#include <nrfx_rtc.h>
#include <nrfx_clock.h>
#include "app_error.h"
#include "nrf_drv_clock.h"
const
nrfx_rtc_t
rtc
=
NRFX_RTC_INSTANCE
(
1
);
/**< Declaring an instance of nrf_drv_rtc for RTC0. */
static
void
rtc_handler
(
nrfx_rtc_int_type_t
int_type
)
{
if
(
int_type
==
NRFX_RTC_INT_TICK
)
{
rt_interrupt_enter
();
rt_tick_increase
();
rt_interrupt_leave
();
}
}
#else
/**
* This is the timer interrupt service routine.
*
...
...
@@ -47,36 +30,14 @@ void SysTick_Handler(void)
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
static
void
clk_event_handler
(
nrfx_clock_evt_type_t
event
){}
void
SysTick_Configuration
(
void
)
{
#ifdef BSP_USING_SOFTDEVICE
nrf_drv_clock_init
();
nrf_drv_clock_lfclk_request
(
NULL
);
uint32_t
err_code
;
#define TICK_RATE_HZ RT_TICK_PER_SECOND
#define SYSTICK_CLOCK_HZ ( 32768UL )
#define NRF_RTC_REG NRF_RTC1
/* IRQn used by the selected RTC */
#define NRF_RTC_IRQn RTC1_IRQn
/* Constants required to manipulate the NVIC. */
#define NRF_RTC_PRESCALER ( (uint32_t) (NRFX_ROUNDED_DIV(SYSTICK_CLOCK_HZ, TICK_RATE_HZ) - 1) )
nrfx_rtc_config_t
config
=
NRFX_RTC_DEFAULT_CONFIG
;
config
.
prescaler
=
NRF_RTC_PRESCALER
;
err_code
=
nrfx_rtc_init
(
&
rtc
,
&
config
,
rtc_handler
);
// APP_ERROR_CHECK(err_code);
nrfx_rtc_tick_enable
(
&
rtc
,
true
);
#define COMPARE_COUNTERTIME (3UL)
/**< Get Compare event COMPARE_TIME seconds after the counter starts from 0. */
//Set compare channel to trigger interrupt after COMPARE_COUNTERTIME seconds
err_code
=
nrfx_rtc_cc_set
(
&
rtc
,
0
,
COMPARE_COUNTERTIME
*
8
,
true
);
// APP_ERROR_CHECK(err_code);
//Power on RTC instance
nrfx_rtc_enable
(
&
rtc
);
#else
nrfx_clock_init
(
clk_event_handler
);
nrfx_clock_enable
();
nrfx_clock_lfclk_start
();
/* Set interrupt priority */
NVIC_SetPriority
(
SysTick_IRQn
,
0xf
);
...
...
@@ -85,7 +46,7 @@ void SysTick_Configuration(void)
nrf_systick_val_clear
();
nrf_systick_csr_set
(
NRF_SYSTICK_CSR_CLKSOURCE_CPU
|
NRF_SYSTICK_CSR_TICKINT_ENABLE
|
NRF_SYSTICK_CSR_ENABLE
);
#endif
}
...
...
bsp/nrf5x/nrf52832/board/sdk_config.h
浏览文件 @
0051092c
...
...
@@ -1899,7 +1899,7 @@
// <e> NRFX_GPIOTE_ENABLED - nrfx_gpiote - GPIOTE peripheral driver
//==========================================================
#ifndef NRFX_GPIOTE_ENABLED
#define NRFX_GPIOTE_ENABLED
1
#define NRFX_GPIOTE_ENABLED
0
#endif
// <o> NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins
#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
...
...
@@ -4382,11 +4382,11 @@
// <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
//==========================================================
#ifndef NRFX_UART_ENABLED
#define NRFX_UART_ENABLED
1
#define NRFX_UART_ENABLED
0
#endif
// <o> NRFX_UART0_ENABLED - Enable UART0 instance
#ifndef NRFX_UART0_ENABLED
#define NRFX_UART0_ENABLED
1
#define NRFX_UART0_ENABLED
0
#endif
// <o> NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录