summaryrefslogtreecommitdiff
path: root/bsp/stm32
diff options
context:
space:
mode:
authorChenxuan Zhao <[email protected]>2020-09-03 14:59:18 +0800
committerChenxuan Zhao <[email protected]>2020-09-03 14:59:18 +0800
commit53e4b9d515093fd3db8e1e51d1de6fc8d9b21053 (patch)
tree6a6974a2d67aee5420d083ecb4c497357bab0c92 /bsp/stm32
parentf3d1e7113171f6e9c2d16dc6725a2f08108931ba (diff)
Add C++ Support
Diffstat (limited to 'bsp/stm32')
-rw-r--r--bsp/stm32/libraries/HAL_Drivers/drv_qspi.h13
-rw-r--r--bsp/stm32/libraries/HAL_Drivers/drv_spi.h12
2 files changed, 21 insertions, 4 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_qspi.h b/bsp/stm32/libraries/HAL_Drivers/drv_qspi.h
index d4609e3dc9..b033ff7ddf 100644
--- a/bsp/stm32/libraries/HAL_Drivers/drv_qspi.h
+++ b/bsp/stm32/libraries/HAL_Drivers/drv_qspi.h
@@ -8,10 +8,19 @@
* 2018-11-27 zylx first version
*/
-#ifndef __DRV_QSPI_H_
-#define __DRV_QSPI_H_
+#ifndef __DRV_QSPI_H__
+#define __DRV_QSPI_H__
+
#include <rtthread.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
rt_err_t stm32_qspi_bus_attach_device(const char *bus_name, const char *device_name, rt_uint32_t pin, rt_uint8_t data_line_width, void (*enter_qspi_mode)(), void (*exit_qspi_mode)());
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_spi.h b/bsp/stm32/libraries/HAL_Drivers/drv_spi.h
index 763a44dfdf..ed4bb9b213 100644
--- a/bsp/stm32/libraries/HAL_Drivers/drv_spi.h
+++ b/bsp/stm32/libraries/HAL_Drivers/drv_spi.h
@@ -8,8 +8,8 @@
* 2018-11-5 SummerGift first version
*/
-#ifndef __DRV_SPI_H_
-#define __DRV_SPI_H_
+#ifndef __DRV_SPI_H__
+#define __DRV_SPI_H__
#include <rtthread.h>
#include "rtdevice.h"
@@ -17,8 +17,16 @@
#include <drv_common.h>
#include "drv_dma.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, GPIO_TypeDef* cs_gpiox, uint16_t cs_gpio_pin);
+#ifdef __cplusplus
+}
+#endif
+
struct stm32_hw_spi_cs
{
GPIO_TypeDef* GPIOx;