drv_spi.h 471 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2021 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef DRV_SPI_H
  7. #define DRV_SPI_H
  8. #include <rtthread.h>
  9. #include <rtdevice.h>
  10. #include <rthw.h>
  11. #include <stdint.h>
  12. #define SPI_CS_TAKE (0)
  13. #define SPI_CS_RELEASE (1)
  14. typedef void (*cs_ctrl_callback_t)(uint32_t value);
  15. rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, cs_ctrl_callback_t callback);
  16. int rt_hw_spi_init(void);
  17. #endif /* DRV_SPI_H */