3ef5278322
1. 部分驱动已经整改,但未验证 2. 根据AT32整改目录结构
42 lines
748 B
C
Executable File
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__
|
|
|