diff options
| author | Bernard Xiong <[email protected]> | 2019-07-03 09:16:09 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-07-03 09:16:09 +0800 |
| commit | c578016f92848398bc433196befbbe0d2ec24078 (patch) | |
| tree | d60c6527738b6fbc922a6e54248376b4b2628619 /bsp/stm32 | |
| parent | 61e4140db2427be1c4fd5d107c1069774fc3c820 (diff) | |
| parent | 0f849fa0ba9bdfa9cee79624ec99c18b33a6e0fd (diff) | |
Merge pull request #2822 from willianchanlovegithub/PANDORA
[bsp][stm32][l475-atk-pandora]Add support for nRF24L01 extension module
Diffstat (limited to 'bsp/stm32')
| -rw-r--r-- | bsp/stm32/stm32l475-atk-pandora/README.md | 2 | ||||
| -rw-r--r-- | bsp/stm32/stm32l475-atk-pandora/applications/nrf24l01_init.c | 23 | ||||
| -rw-r--r-- | bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 7 |
3 files changed, 31 insertions, 1 deletions
diff --git a/bsp/stm32/stm32l475-atk-pandora/README.md b/bsp/stm32/stm32l475-atk-pandora/README.md index 20d099a3f0..10b299dd06 100644 --- a/bsp/stm32/stm32l475-atk-pandora/README.md +++ b/bsp/stm32/stm32l475-atk-pandora/README.md @@ -71,9 +71,9 @@ | USB Device | 暂不支持 | 即将支持 | | USB Host | 暂不支持 | 即将支持 | | **扩展模块** | **支持情况** | **备注** | +| NRF24L01 模块 | 支持 | 根据实际板子接线情况修改 NRF24L01 软件包中的 `NRF24L01_CE_PIN` 和 `NRF24_IRQ_PIN` 的宏定义,以及 SPI 设备名 | | ATK-ESP8266 模块 | 暂不支持 | 即将支持 | | enc28j60 模块 | 暂不支持 | 即将支持 | - 使用该开发板的更多高级功能请参考 RT-Thread 代码仓库: [RT-Thread IoT-Board SDK](https://github.com/RT-Thread/IoT_Board)。 ## 使用说明 diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/nrf24l01_init.c b/bsp/stm32/stm32l475-atk-pandora/applications/nrf24l01_init.c new file mode 100644 index 0000000000..26b4d63b85 --- /dev/null +++ b/bsp/stm32/stm32l475-atk-pandora/applications/nrf24l01_init.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-06-29 WillianChan first version + */ + +#include <rtthread.h> + +#ifdef PKG_USING_NRF24L01 + +#include "drv_spi.h" +static int rt_hw_nrf24l01_init(void) +{ + rt_hw_spi_device_attach("spi2", "spi20", GPIOD, GPIO_PIN_5); + return RT_EOK; +} +INIT_COMPONENT_EXPORT(rt_hw_nrf24l01_init); + +#endif diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index ff1f4b2827..a09e96da0a 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -255,6 +255,13 @@ endmenu menu "Board extended module Drivers" + config BSP_USING_NRF24L01 + bool "Enable NRF24L01" + select BSP_USING_SPI + select BSP_USING_SPI2 + select PKG_USING_NRF24L01 + default n + endmenu endmenu |
