u8g2_port.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef __U8G_PORT_H__
  2. #define __U8G_PORT_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <rtthread.h>
  7. #include <rtdevice.h>
  8. #if defined U8G2_USE_HW_SPI
  9. #include <drv_spi.h>
  10. #endif
  11. #include <string.h>
  12. #include <u8g2.h>
  13. #include <u8x8.h>
  14. #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
  15. #if defined U8G2_USE_HW_SPI
  16. #ifndef U8G2_SPI_BUS_NAME
  17. #define U8G2_SPI_BUS_NAME "spi1"
  18. #endif
  19. #ifndef U8G2_SPI_DEVICE_NAME
  20. #define U8G2_SPI_DEVICE_NAME "spi10"
  21. #endif
  22. uint8_t u8x8_byte_rtthread_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
  23. #endif
  24. #if defined U8G2_USE_HW_I2C
  25. #ifndef U8G2_I2C_DEVICE_NAME
  26. #define U8G2_I2C_DEVICE_NAME "i2c2"
  27. #endif
  28. uint8_t u8x8_byte_rtthread_hw_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
  29. #endif
  30. uint8_t u8x8_gpio_and_delay_rtthread(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif /* __U8G_PORT_H__ */