summaryrefslogtreecommitdiff
path: root/bsp/airm2m/air105/libraries/rt_drivers/drv_spi.h
blob: 46114d57566d59ca0ddad0c45f759431d70f07ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-02-22     airm2m       first version
 */


#ifndef __DRV_SPI_H__
#define __DRV_SPI_H__

#include <rtthread.h>
#include "rtdevice.h"
#include <rthw.h>
#include <drv_common.h>
#include "drv_config.h"

#ifdef __cplusplus
extern "C" {
#endif

struct air_spi
{
    const char bus_name[RT_NAME_MAX];
    rt_uint8_t          id;
    struct rt_spi_bus   bus;
};

rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, rt_uint8_t cs_pin);

#ifdef __cplusplus
}
#endif

#endif /*__DRV_SPI_H__ */