1 /* 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 16 int spi_init(void); 17 int spi_claim_bus(void); 18 void spi_release_bus(void); 19 int spi_xfer(uint32_t bitlen, const void *dout, void *din, uint32_t flags); 20 21 #endif /* _SPI_H_ */ 22