blob: 34da0e11140bdb1b23ad19aad28a7f7fd99bf016 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Julius Werner4783db22018-03-27 16:28:52 -07002#ifndef _SPI_BITBANG_H_
3#define _SPI_BITBANG_H_
4
5#include <types.h>
6
7struct spi_bitbang_ops {
8 int (*get_miso)(const struct spi_bitbang_ops *ops);
9 void (*set_mosi)(const struct spi_bitbang_ops *ops, int value);
10 void (*set_clk)(const struct spi_bitbang_ops *ops, int value);
11 void (*set_cs)(const struct spi_bitbang_ops *ops, int value);
12};
13
14int spi_bitbang_claim_bus(const struct spi_bitbang_ops *ops);
15void spi_bitbang_release_bus(const struct spi_bitbang_ops *ops);
16int spi_bitbang_xfer(const struct spi_bitbang_ops *ops, const void *dout,
17 size_t bytes_out, void *din, size_t bytes_in);
18
19#endif /* _SPI_BITBANG_H_ */