linyuanbo_breo_server 3ef5278322 feat : 基于AT32,将各驱动移植整改待验证
1. 部分驱动已经整改,但未验证
2. 根据AT32整改目录结构
2021-08-19 08:19:02 +00:00

42 lines
748 B
C
Executable File

/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-01-09 shelton first version
*/
#ifndef __DRV_SPI__
#define __DRV_SPI__
#include <rtthread.h>
#include <drivers/spi.h>
#include "n32g45x.h"
struct n32_spi_config
{
SPI_Module *spix;
const char *spi_name;
};
struct n32_spi
{
struct n32_spi_config *config;
struct rt_spi_bus spi_bus;
};
struct n32_spi_cs
{
GPIO_Module *GPIOx;
uint32_t GPIO_Pin;
};
/* public function */
int rt_hw_spi_init(void);
rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, GPIO_Module *cs_gpiox, uint16_t cs_gpio_pin);
#endif // __DRV_SPI__