Merge pull request #3875 from ChenxuanZhao/develop

[bsp/stm32] Add C++ Support
This commit is contained in:
Bernard Xiong 2020-09-04 08:48:03 +08:00 committed by GitHub
commit 21c42e6c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 5 deletions

View File

@ -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 /* __DRV_QSPI_H__ */

View File

@ -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;
@ -59,4 +67,4 @@ struct stm32_spi
struct rt_spi_bus spi_bus;
};
#endif /*__DRV_SPI_H_ */
#endif /*__DRV_SPI_H__ */