spi.h 475 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (c) 2017 - 2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SPI_H
  7. #define SPI_H
  8. #include <stdint.h>
  9. #define SPI_XFER_BEGIN (1 << 0) /* Assert CS before transfer */
  10. #define SPI_XFER_END (1 << 1) /* De-assert CS after transfer */
  11. #define SPI_XFER_QUAD (1 << 2)
  12. int spi_init(void);
  13. int spi_claim_bus(void);
  14. void spi_release_bus(void);
  15. int spi_xfer(uint32_t bitlen, const void *dout, void *din, uint32_t flags);
  16. #endif /* _SPI_H_ */