summaryrefslogtreecommitdiff
path: root/bsp/hpmicro/libraries/drivers/drv_spi.h
blob: b03349de86deddfd4af46eb0f5b2d3397a7d0ce8 (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
/*
 * Copyright (c) 2021 hpmicro
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef DRV_SPI_H
#define DRV_SPI_H

#include <rtthread.h>
#include <rtdevice.h>
#include <rthw.h>
#include <stdint.h>


#define SPI_CS_TAKE (0)
#define SPI_CS_RELEASE (1)

typedef void (*cs_ctrl_callback_t)(uint32_t value);

rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, cs_ctrl_callback_t callback);

int rt_hw_spi_init(void);



#endif /* DRV_SPI_H */