blob: 9d92d8cfc35b6e4f6319bfdf523a571340caccb2 [file] [log] [blame]
Sheetal Tigadoli3bb1b4c2020-01-05 21:19:02 +05301/*
2 * Copyright (c) 2017 - 2020, Broadcom
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef SPI_H
8#define SPI_H
9
10#include <stdint.h>
11
12#define SPI_XFER_BEGIN (1 << 0) /* Assert CS before transfer */
13#define SPI_XFER_END (1 << 1) /* De-assert CS after transfer */
14#define SPI_XFER_QUAD (1 << 2)
15
16int spi_init(void);
17int spi_claim_bus(void);
18void spi_release_bus(void);
19int spi_xfer(uint32_t bitlen, const void *dout, void *din, uint32_t flags);
20
21#endif /* _SPI_H_ */